Title: lab-ops-hub: container validator accepts space hosts and IPvFuture literals the Worker validator refuses · Issue #507 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator accepts space hosts and IPvFuture literals the Worker validator refuses · Issue #507 · developing-today/code
X Title: lab-ops-hub: container validator accepts space hosts and IPvFuture literals the Worker validator refuses · Issue #507 · developing-today/code
Description: Summary The lab-ops-hub container crawler's validate_crawl_url (pkgs/lab-ops-hub/container/app.py) accepts two host forms the Worker's validateCrawlUrl (pkgs/lab-ops-hub/src/lib.ts:129) refuses outright, classifying both as "a public DNS...
Open Graph Description: Summary The lab-ops-hub container crawler's validate_crawl_url (pkgs/lab-ops-hub/container/app.py) accepts two host forms the Worker's validateCrawlUrl (pkgs/lab-ops-hub/src/lib.ts:129) refuses out...
X Description: Summary The lab-ops-hub container crawler's validate_crawl_url (pkgs/lab-ops-hub/container/app.py) accepts two host forms the Worker's validateCrawlUrl (pkgs/lab-ops-hub/src/lib.ts:129) ref...
Opengraph URL: https://github.com/developing-today/code/issues/507
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator accepts space hosts and IPvFuture literals the Worker validator refuses","articleBody":"## Summary\n\nThe lab-ops-hub container crawler's `validate_crawl_url` (`pkgs/lab-ops-hub/container/app.py`) accepts two host forms the Worker's `validateCrawlUrl` (`pkgs/lab-ops-hub/src/lib.ts:129`) refuses outright, classifying both as \"a public DNS name\" — a verdict the container's own fetcher then contradicts:\n\n| Input | TS Worker | Python container |\n| --- | --- | --- |\n| `http://exam ple.com/` | BLOCK (\"url is not a valid URL\") | **ALLOW** (returned verbatim as a public DNS name) |\n| `http://exa mple.com/` | BLOCK | **ALLOW** |\n| `http://[v1.fe80::]/` | BLOCK (\"url is not a valid URL\") | **ALLOW** |\n| `http://[v7.a]/` | BLOCK | **ALLOW** |\n| `http://[vf.FF]/` | BLOCK | **ALLOW** |\n\nControls, identical on both sides (must not change): `http://exam_ple.com/` ALLOW/ALLOW, `http://exam-ple.com/` ALLOW/ALLOW, `http://exam ple.local/` BLOCK/BLOCK (the `.local` suffix check fires first).\n\n## Evidence\n\nVerified this run on main `1f2ae9f4` by driving both real validators over the same inputs (TS via bun importing `src/lib.ts`, Python by importing `container/app.py`):\n\n- Space in host: `urlparse` hands the host through verbatim; no check in `validate_crawl_url` inspects it for whitespace, `ipaddress` rejects it, `_inet_aton_ipv4` returns `None`, the final label (`com`) is not numeric, so the function returns the raw URL as \"a public DNS name\" (app.py:79). The fetcher disagrees: `http.client.HTTPConnection(\"exam ple.com\")` raises `InvalidURL: URL can't contain control characters` — the crawl dies deep inside the fetcher with a low-level error instead of the validator's clean refusal. This is exactly the failure shape #502 fixed for ports (\"urlparse only raises for it lazily, deep inside the fetcher, so read it here and refuse up front\", app.py:34-41) — the host form was not given the same treatment.\n- IPvFuture literals: `urlparse` strips the brackets, so the host is `v1.fe80::`; it is not a valid IPv6 literal, contains characters the `_inet_aton_ipv4` gate rejects, and its final label is not numeric, so it too falls through to \"a public DNS name\". A DNS name never contains `:`; the bracketed form was an IP-literal position in the URL, and an IP literal the validator cannot judge must fail closed (the principle #505 applied to `%` hosts and zone ids).\n\n## Why it matters\n\nThe container validator is the defence-in-depth re-check on the component that actually fetches (#441), and the parity premise of #468/#502/#505 is that where the two validators disagree, the effective policy is the weaker one. Here the weaker side does not merely allow a fetch the other refuses — it certifies hosts that are not DNS names at all, pushing the failure into the fetcher as an unhandled `InvalidURL`/resolution error and leaving the guard's verdict meaningless for a whole class of malformed hosts.\n\n## Acceptance criteria\n\n- `validate_crawl_url` refuses a host containing a space or control character (anything `http.client` would reject as a control character, i.e. ord \u003c= 0x20) with a clear validator error.\n- `validate_crawl_url` refuses a bracketed host that is not a valid IPv6 literal (IPvFuture and any other `[...]` form `ipaddress` cannot parse), instead of reclassifying it as a DNS name.\n- Regression tests in `test/test_container_validate.py` cover both classes; the controls above (`exam_ple.com`, valid IPv6 literals, ordinary DNS names) still pass.\n- The TS validator needs no change (it already refuses both classes); `npm test` in `pkgs/lab-ops-hub` stays green on both suites.\n\nSingle-repo: lab-ops-hub exists only in developing-today/code. Distinct from #504 (bare `0x` final labels) and #505 (percent-encoded hosts / IPv6 zone ids), which cover neighbouring spellings, not these two classes.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-21T21:20:46Z","url":"https://github.com/developing-today/code/issues/507"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2292ea4b-c200-b40c-df54-9ff4ef1d4bae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D16E:259026:A54B4D:D6E4EC:6B063950 |
| html-safe-nonce | e94e65684d2b67c83a5ccde5ad14cc38d7f82cdccdf1d35e1d553b692fbb9de5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTZFOjI1OTAyNjpBNTRCNEQ6RDZFNEVDOjZCMDYzOTUwIiwidmlzaXRvcl9pZCI6IjMwNjA5MzQwMDQzNjM5MDEyNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b8c726e3c5360d2f1863f65ae3a5babb9d48f613ada608ba74a38493e7f932b7 |
| hovercard-subject-tag | issue:5968737035 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/507/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0196da54c908d2c5bfffcde2d1a61af19e9328ca9a56e4dfc366dabafd261db/developing-today/code/issues/507 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0196da54c908d2c5bfffcde2d1a61af19e9328ca9a56e4dfc366dabafd261db/developing-today/code/issues/507 |
| og:image:alt | Summary The lab-ops-hub container crawler's validate_crawl_url (pkgs/lab-ops-hub/container/app.py) accepts two host forms the Worker's validateCrawlUrl (pkgs/lab-ops-hub/src/lib.ts:129) refuses out... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width