Skip to content

GUACAMOLE-2185: Port numbers should be validated by guacd.#627

Merged
necouchman merged 1 commit intoapache:staging/1.6.1from
bbennett-ks:GUACAMOLE-2185-Port_numbers_should_be_validated_by_guacd
Jan 27, 2026
Merged

GUACAMOLE-2185: Port numbers should be validated by guacd.#627
necouchman merged 1 commit intoapache:staging/1.6.1from
bbennett-ks:GUACAMOLE-2185-Port_numbers_should_be_validated_by_guacd

Conversation

@bbennett-ks
Copy link
Contributor

@bbennett-ks bbennett-ks commented Dec 12, 2025

  • Tested RDP, SSH, Telnet , and VNC using valid and invalid port numbers and verifying DEBUG logs.

Copy link
Contributor

@necouchman necouchman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'm okay with it. Just a few comments.

The only other concern I have is if there's any potential impact to ABI or API compatibility since this changes the type of several of those settings members from int to unsigned short? We generally try not to break compatibility in minor version releases like this, so I just want to make sure that doesn't bite us (or, more importantly, our users).

@bbennett-ks
Copy link
Contributor Author

Overall I'm okay with it. Just a few comments.

The only other concern I have is if there's any potential impact to ABI or API compatibility since this changes the type of several of those settings members from int to unsigned short? We generally try not to break compatibility in minor version releases like this, so I just want to make sure that doesn't bite us (or, more importantly, our users).

It should be OK based on how it is used, but I'll revert those changes as they are unnecessary and adds risk.

@bbennett-ks bbennett-ks marked this pull request as draft December 12, 2025 20:16
@bbennett-ks bbennett-ks force-pushed the GUACAMOLE-2185-Port_numbers_should_be_validated_by_guacd branch from 4ec4a38 to ec4bbe0 Compare December 12, 2025 22:41
@bbennett-ks
Copy link
Contributor Author

bbennett-ks commented Dec 12, 2025

Overall I'm okay with it. Just a few comments.
The only other concern I have is if there's any potential impact to ABI or API compatibility since this changes the type of several of those settings members from int to unsigned short? We generally try not to break compatibility in minor version releases like this, so I just want to make sure that doesn't bite us (or, more importantly, our users).

It should be OK based on how it is used, but I'll revert those changes as they are unnecessary and adds risk.

On second thought, the core fix that changes an out of range port value (doesn't fit inside an unsigned short) to the default value changes the ABI/API compatibility. So, changing the underlying data type doesn't introduce any additional functional impact. So if it's OK, I'll leave the changes.

@bbennett-ks bbennett-ks marked this pull request as ready for review December 12, 2025 22:52
@bbennett-ks bbennett-ks force-pushed the GUACAMOLE-2185-Port_numbers_should_be_validated_by_guacd branch from ec4bbe0 to 922afc5 Compare December 16, 2025 01:50
Copy link
Contributor

@necouchman necouchman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of additional changes, and I think there are still a couple of past items to be finished up.

@bbennett-ks bbennett-ks force-pushed the GUACAMOLE-2185-Port_numbers_should_be_validated_by_guacd branch from 922afc5 to f1e21ca Compare January 26, 2026 20:38
@bbennett-ks
Copy link
Contributor Author

A couple of additional changes, and I think there are still a couple of past items to be finished up.

Please let me know if I need to make any additional changes. Thanks!

@necouchman
Copy link
Contributor

@bbennett-ks Looks like the build is failing - maybe a missing include in the K8s protocol:

#20 19.45 settings.c: In function 'guac_kubernetes_parse_args':
#20 19.45 settings.c:283:57: error: 'GUAC_ITOA_USHORT_MIN' undeclared (first use in this function)
#20 19.45   283 |                 IDX_PORT, GUAC_KUBERNETES_DEFAULT_PORT, GUAC_ITOA_USHORT_MIN, GUAC_ITOA_USHORT_MAX);
#20 19.45       |                                                         ^~~~~~~~~~~~~~~~~~~~
#20 19.45 settings.c:283:57: note: each undeclared identifier is reported only once for each function it appears in
#20 19.51 settings.c:283:79: error: 'GUAC_ITOA_USHORT_MAX' undeclared (first use in this function)
#20 19.51   283 |                 IDX_PORT, GUAC_KUBERNETES_DEFAULT_PORT, GUAC_ITOA_USHORT_MIN, GUAC_ITOA_USHORT_MAX);
#20 19.51       |                                                                               ^~~~~~~~~~~~~~~~~~~~

@bbennett-ks bbennett-ks force-pushed the GUACAMOLE-2185-Port_numbers_should_be_validated_by_guacd branch from f1e21ca to 95dfbfe Compare January 27, 2026 19:59
@bbennett-ks
Copy link
Contributor Author

@bbennett-ks Looks like the build is failing - maybe a missing include in the K8s protocol:

#20 19.45 settings.c: In function 'guac_kubernetes_parse_args':
#20 19.45 settings.c:283:57: error: 'GUAC_ITOA_USHORT_MIN' undeclared (first use in this function)
#20 19.45   283 |                 IDX_PORT, GUAC_KUBERNETES_DEFAULT_PORT, GUAC_ITOA_USHORT_MIN, GUAC_ITOA_USHORT_MAX);
#20 19.45       |                                                         ^~~~~~~~~~~~~~~~~~~~
#20 19.45 settings.c:283:57: note: each undeclared identifier is reported only once for each function it appears in
#20 19.51 settings.c:283:79: error: 'GUAC_ITOA_USHORT_MAX' undeclared (first use in this function)
#20 19.51   283 |                 IDX_PORT, GUAC_KUBERNETES_DEFAULT_PORT, GUAC_ITOA_USHORT_MIN, GUAC_ITOA_USHORT_MAX);
#20 19.51       |                                                                               ^~~~~~~~~~~~~~~~~~~~

Ah, libwebsockets-devel wasn't installed on my new dev VM so Kubernetes support wasn't enabled. Verified all protocols were enabled.

@necouchman necouchman merged commit 5e3e43f into apache:staging/1.6.1 Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants