Repository navigation
fix(lab-ops-hub): container validator refuses space hosts and IPvFuture literals - #508
Conversation
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. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 2
✨ Finishing Touches
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebbeb8bca0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # rejects it outright, urlparse hands it through verbatim, and | ||
| # http.client only raises for it deep inside the fetcher — the same | ||
| # lazy-failure shape #502 fixed for ports. Refuse up front (#507). | ||
| if any(ord(c) <= 0x20 for c in host): |
There was a problem hiding this comment.
Reject DEL alongside the other control characters
For a target such as http://exam\x7fple.com/, urlparse preserves DEL in the hostname, but this predicate accepts it because U+007F is above U+0020. The Worker’s WHATWG parser rejects the URL, while the container proceeds until http.client raises InvalidURL, recreating the deep-fetch failure this change is intended to prevent. Include DEL (and preferably the full relevant control-character range) in the upfront rejection.
Useful? React with 👍 / 👎.
Fixes #507
The container crawler's
validate_crawl_urlclassified two host forms as "a public DNS name" that the Worker'svalidateCrawlUrlrefuses outright:http://exam ple.com/):urlparsehands the host through verbatim and the old code returned it as a DNS name; the fetcher then died deep insidehttp.clientwithInvalidURL: URL can't contain control characters— the same lazy-failure shape lab-ops-hub: container crawler treats invalid IPv4 spellings, numeric-final-label hosts and malformed ports as public DNS names #502 fixed for ports. The validator now refuses any host containing a character with ord <= 0x20, up front.http://[v1.fe80::]/,http://[v7.a]/): these occupied the IP-literal position but are not valid IPv6 literals (IPvFuture forms).urlparsestrips the brackets, so the check inspects the netloc in the DNS-name fall-through and fails closed instead of reclassifying the host as a public DNS name.Verified:
npm testinpkgs/lab-ops-hub: TS suite + Python suite 11/11 (1 new regression test covering both classes).container/app.pyreverted, the new test fails; restored, all green.exam_ple.com, ordinary DNS names, valid IPv6 literals and public targets still accepted (existing suite).Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
Bug Fixes
Tests