Title: lab-ops-hub: container validator still allows bare 0x hosts (example.0x, 0x) that the Worker validator refuses · Issue #504 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator still allows bare 0x hosts (example.0x, 0x) that the Worker validator refuses · Issue #504 · developing-today/code
X Title: lab-ops-hub: container validator still allows bare 0x hosts (example.0x, 0x) that the Worker validator refuses · Issue #504 · developing-today/code
Description: Summary PR #503 (fixes #502, merge eaf371c9, commit 6ff8f354) made the lab-ops-hub container crawler's validate_crawl_url refuse hosts whose final label is numeric, mirroring the Worker's WHATWG ends-in-a-number rule — but the refusal pa...
Open Graph Description: Summary PR #503 (fixes #502, merge eaf371c9, commit 6ff8f354) made the lab-ops-hub container crawler's validate_crawl_url refuse hosts whose final label is numeric, mirroring the Worker's WHATWG en...
X Description: Summary PR #503 (fixes #502, merge eaf371c9, commit 6ff8f354) made the lab-ops-hub container crawler's validate_crawl_url refuse hosts whose final label is numeric, mirroring the Worker's W...
Opengraph URL: https://github.com/developing-today/code/issues/504
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator still allows bare 0x hosts (example.0x, 0x) that the Worker validator refuses","articleBody":"## Summary\n\nPR #503 (fixes #502, merge `eaf371c9`, commit `6ff8f354`) made the lab-ops-hub container crawler's `validate_crawl_url` refuse hosts whose final label is numeric, mirroring the Worker's WHATWG ends-in-a-number rule — but the refusal pattern requires at least one hex digit after a `0x` prefix, so a **bare** `0x`/`0X` final label still falls through to \"a public DNS name\" in the container validator while the Worker validator refuses every spelling:\n\n| Input | TS Worker (`validateCrawlUrl`, `src/lib.ts:129`) | Python container (`validate_crawl_url`, `container/app.py`) |\n| --- | --- | --- |\n| `http://example.0x/` | BLOCK (\"url is not a valid URL\") | **ALLOW** |\n| `http://example.0X/` | BLOCK | **ALLOW** |\n| `http://example.0x./` | BLOCK | **ALLOW** |\n| `http://0x/` | BLOCK (WHATWG normalises to `0.0.0.0`, non-public IPv4) | **ALLOW** |\n| `http://0X/` | BLOCK | **ALLOW** |\n\n## Evidence\n\n- Current main `eaf371c9`: `pkgs/lab-ops-hub/container/app.py:65-66` —\n ```python\n last_label = host.rsplit(\".\", 1)[-1]\n if re.fullmatch(r\"0[xX][0-9a-fA-F]+|[0-9]+\", last_label):\n ```\n The `+` means `0x` with no following hex digit never matches, and a single-label `0x` host takes the same fall-through (`_inet_aton_ipv4(\"0x\")` returns `None` — `socket.inet_aton(\"0x\")` raises \"illegal IP address string\", verified directly).\n- WHATWG's IPv4-number parser returns `0` for a bare `0x` prefix (the digit sequence after the prefix is empty), so the host ends in a number: `new URL(\"http://example.0x/\")` throws, and `new URL(\"http://0x/\")` normalises the host to `0.0.0.0`.\n- Both real validators were driven over the same inputs on current main this run (TS via `node --experimental-strip-types` importing `src/lib.ts`, Python by importing `container/app.py`): the five rows above diverge; the PR's claimed ~600-input differential parity evidently did not generate the empty-hex-digit case.\n- Controls verified identical on both sides (must not change): `example.0x7f` BLOCK/BLOCK, `example.08` BLOCK/BLOCK, `dead.beef` ALLOW/ALLOW, `example.0xg` ALLOW/ALLOW, `example.0x7fg` ALLOW/ALLOW (a non-hex trailing character makes the label not an IPv4 number in WHATWG either, so it stays a DNS name).\n\n## Why it matters\n\nThe container validator is the defence-in-depth re-check on the component that actually fetches (#441), and #502's premise — where the two validators disagree, the effective policy is the weaker one — is exactly this class. A host spelling the URL grammar reserves for an IP literal (`0x` = `0.0.0.0`, the non-public \"this host\" network as a single label) is reclassified as a public DNS name and handed to the fetcher's resolver instead of being refused up front with the validator's clean error. This is the residual of the change PR #503 landed to close #502, not a new policy question.\n\n## Acceptance criteria\n\n- `validate_crawl_url` refuses a host whose final label is a bare `0x`/`0X` (no hex digits) when the host does not parse as an IPv4 address — including the single-label forms `0x`/`0X` and the trailing-dot spelling `example.0x.`.\n- Non-numeric-final-label names stay allowed on both sides: `dead.beef`, `a1.beef`, `123.example.com`, and the non-hex-trailing controls `example.0xg` / `example.0x7fg`.\n- Regression tests in `pkgs/lab-ops-hub/test/test_container_validate.py` cover the bare-`0x` spellings (initial URL; redirect targets inherit via the same function), and `npm test` in `pkgs/lab-ops-hub` (TS + Python suites) stays green.\n- A TS/Python differential probe that includes the bare-`0x` cases shows no verdict divergence for this class.\n\nSingle-repo: lab-ops-hub exists only in developing-today/code (no `validate_crawl_url`/`validateCrawlUrl` copy in the opencode/openchamber/nix clones).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-21T20:45:02Z","url":"https://github.com/developing-today/code/issues/504"}
| 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:62314bc4-f027-4aa2-4d21-e535e342b588 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDA2:3373A3:787E41:9B51E4:6B0628A2 |
| html-safe-nonce | 476ee1c23d224f34cd6a626231ca005a6f7478910775b8b1ced98f4d6a2db030 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREEyOjMzNzNBMzo3ODdFNDE6OUI1MUU0OjZCMDYyOEEyIiwidmlzaXRvcl9pZCI6Ijg0MDM1Mjg3ODI2MDYzNzkxNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2f8ac538c42541843bbbe65e6594e21791e88b1f85979083e56d7e6540d8b0fe |
| hovercard-subject-tag | issue:5968236636 |
| 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/504/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f5d33968f180abf516186b9a375755322b8da1f7d5829a28a4b979291572b7b0/developing-today/code/issues/504 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f5d33968f180abf516186b9a375755322b8da1f7d5829a28a4b979291572b7b0/developing-today/code/issues/504 |
| og:image:alt | Summary PR #503 (fixes #502, merge eaf371c9, commit 6ff8f354) made the lab-ops-hub container crawler's validate_crawl_url refuse hosts whose final label is numeric, mirroring the Worker's WHATWG en... |
| 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 | 9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce |
| 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 | 32e57d5cc2ce6ce92ec6dceb65858344750c27c2 |
| 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