GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(lab-ops-hub): container validator refuses numeric-final-label hosts and malformed ports by dezren39 · Pull Request #503 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ff8f35473
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # refuse it instead of reclassifying it as a public DNS | ||
| # name, matching the Worker's validator (#502). | ||
| last_label = host.rsplit(".", 1)[-1] | ||
| if re.fullmatch(r"0[xX][0-9a-fA-F]+|[0-9]+", last_label): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Treat a bare hexadecimal prefix as a numeric label
When the container validates a direct request or redirect ending in 0x or 0X (for example, http://example.0x/), this regex requires at least one following hexadecimal digit and therefore accepts the URL as a DNS name. The Worker's WHATWG parser rejects the same URL because a bare hexadecimal prefix still triggers its ends-in-a-number handling, so the validators remain inconsistent and the container proceeds to a DNS fetch that the Worker refuses. Allow the hexadecimal digit portion to be empty or otherwise handle these two labels explicitly.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| try: | ||
| u.port | ||
| except ValueError: | ||
| raise ValueError("url has an invalid port") from None |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Handle backslashes before validating the port
For a redirect target such as http://example.com:80\\/path, the Worker's WHATWG URL parser treats the backslash as a path separator and accepts it as http://example.com//path, but urlparse leaves the backslash in the port string, so reading u.port now rejects the target. Because redirects are passed through this validator before the container fetches them, an otherwise Worker-valid redirect unnecessarily abandons the container path and breaks the validator-parity goal; normalize special-scheme backslashes or parse with equivalent semantics before applying the port check.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
lab-ops-hub: container crawler treats invalid IPv4 spellings, numeric-final-label hosts and malformed ports as public DNS names
There was an error while loading. Please reload this page.