Skip to content

fix(supervisor): validate HostPort digits and range instead of bare parseInt - #390

Merged
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Ayush7614:fix/supervisor-hostport-validation
Sep 6, 2026
Merged

fix(supervisor): validate HostPort digits and range instead of bare parseInt#390
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Ayush7614:fix/supervisor-hostport-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

inspectOwned passed Docker's HostPort string straight into Number.parseInt: "abc" became a NaN port, "0" and out-of-range values were reported as ports nothing can dial, and the listOwned path (numeric PublicPort) disagreed with it.

Adds an exported parseHostPort helper that only accepts digit strings in 1-65535 and omits anything else, and uses it in inspectOwned. Verified with a 13-case script plus supervisor typecheck and the 14 existing listen-port/memory-bytes/names tests green.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep-reviewed against live code (correctness, governance, no vendor/secret/scale issues). Composed build+tests green. CHANGELOG/format rebase on CI-validated substance.

@davidmckayv
davidmckayv merged commit 6380422 into CopilotKit:main Sep 6, 2026
14 checks 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