Title: lab-ops-hub: container validator accepts IDNA-invalid hosts the Worker refuses — unassigned codepoints and bidi-violating mixed labels · Issue #583 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator accepts IDNA-invalid hosts the Worker refuses — unassigned codepoints and bidi-violating mixed labels · Issue #583 · developing-today/code
X Title: lab-ops-hub: container validator accepts IDNA-invalid hosts the Worker refuses — unassigned codepoints and bidi-violating mixed labels · Issue #583 · developing-today/code
Description: Summary The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) certifies hosts that are not valid IDNA/UTS-46 domain names at all — and that the Worker's validator refuses outright — in (at least) two whole...
Open Graph Description: Summary The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) certifies hosts that are not valid IDNA/UTS-46 domain names at all — and that the Worker's validator re...
X Description: Summary The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) certifies hosts that are not valid IDNA/UTS-46 domain names at all — and that the Worker's validato...
Opengraph URL: https://github.com/developing-today/code/issues/583
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator accepts IDNA-invalid hosts the Worker refuses — unassigned codepoints and bidi-violating mixed labels","articleBody":"## Summary\n\nThe container crawl validator (`pkgs/lab-ops-hub/container/app.py`, `validate_crawl_url`) certifies hosts that are not valid IDNA/UTS-46 domain names at all — and that the Worker's validator refuses outright — in (at least) two whole classes the hand-maintained checks cannot see:\n\n1. **Unassigned codepoints.** A label containing a codepoint Unicode has not assigned (e.g. U+0378, U+0380, U+05EB) is accepted and passed on as a public DNS name.\n2. **Bidi-rule violations.** A label mixing left-to-right Latin with right-to-left Hebrew/Arabic characters (e.g. `exאample.com`, `localאhost`) is accepted, even though IDNA's bidi requirements forbid it — Python's own stdlib IDNA codec raises `Violation of BIDI requirement 2` on exactly this input, but the validator never calls it.\n\nThe Worker side needs no code to reject these: `new URL()` / WHATWG domain-to-ASCII (UTS-46, `CheckBidi` + disallowed/unassigned checks) throws, and `validateCrawlUrl` (`pkgs/lab-ops-hub/src/lib.ts`) returns `url is not a valid URL`. So the two validators that are supposed to hold the same crawl-target policy (#441 defence in depth: the component that actually fetches re-validates independently) disagree on thousands of spellings.\n\n## Evidence (verified 2026-10-22 on main `59ba8cf1`)\n\nDifferential probe: every codepoint U+0080–U+32FF inserted into `ex\u003ccp>ample.com` and `local\u003ccp>host`, plus script-digit IP spellings and ASCII structural insertions — 26,040 hosts run through both real validators (Python `validate_crawl_url` imported from `container/app.py`; TS `validateCrawlUrl` imported from `src/lib.ts`):\n\n- **3,174 divergences, all in one direction** (container accepts / Worker refuses); **0** in the reverse direction.\n- By first non-ASCII codepoint: ~2,070 unassigned, ~1,001 RTL bidi (`AL`/`R`), plus smaller pockets (e.g. U+0601, U+066B, U+115F, enclosed digits like U+2478).\n\nHeadline cases:\n\n| URL | container `validate_crawl_url` | Worker `validateCrawlUrl` / `new URL` |\n|---|---|---|\n| `http://exאample.com/` (Latin + Hebrew alef in one label) | **accepts**, returns URL unchanged | rejects — `new URL` throws |\n| `http://ample.com/` (U+0378, unassigned) | **accepts** | rejects — `new URL` throws |\n| `http://localאhost/` | **accepts** | rejects — `new URL` throws |\n| `http://אא.com/` (pure RTL label, control) | accepts | accepts (`xn--4dba.com`) — validators agree |\n\nRoot cause, `container/app.py`:\n\n- `validate_crawl_url` (line 62) never performs an IDNA validity check on the mapped host. Its only IDNA-adjacent step is the length check at line 190, which measures `\"xn--\" + label.encode(\"punycode\")` — raw punycode encoding succeeds for *any* string, valid IDN or not.\n- The invalid-codepoint defence is the hand-enumerated `_IDNA_DISALLOWED` frozenset (line 55, from #516: ~30 codepoints). A denylist cannot cover unassigned ranges (thousands of codepoints, growing/shrinking per Unicode version) or contextual rules like bidi, which are properties of the whole label, not of single codepoints.\n- Even the obvious quick fix is insufficient on its own: `\"exאample\".encode(\"idna\")` raises the bidi error (verified), but `\"\\u0378\".encode(\"idna\")` happily returns `b\"xn--zva\"` — the stdlib IDNA-2003 codec accepts unassigned codepoints that UTS-46 marks disallowed. Parity needs a check that matches WHATWG behaviour for both classes, not just a codec call.\n\nConsequences, same shapes this series has fixed before (#502, #507, #516):\n\n- The container certifies a non-name as a public DNS name; for bidi-violating spellings the failure then surfaces deep inside the fetcher (the resolver's IDNA step raises) as a 502 crawl failure, instead of the validator's up-front refusal — and the Worker fallback never sees the target the same way, so behaviour depends on which crawler runs.\n- Defence in depth is weakened asymmetrically: any future check layered on \"the validator only passes real DNS names\" (blocked-suffix, length, punycode A-label handling — cf. open #580) is reasoning about a host form this gap lets through unjudged in IDNA terms.\n\n## Acceptance criteria\n\n- `validate_crawl_url` refuses hosts whose labels are not valid UTS-46/IDNA domain labels — covering at minimum the unassigned-codepoint and bidi-violation classes above — with the same accept/refuse verdict as the Worker's `validateCrawlUrl` on a differential battery (the 26,040-host probe above, or an equivalent committed test corpus).\n- Pure RTL labels, ordinary IDN (`münchen.de`), and every currently-accepted public host in the existing suites stay accepted; CONTEXTJ handling stays as tracked separately in #531 (this issue is about spellings the Worker *refuses*).\n- New tests in `test/test_container_validate.py` pin the headline cases (mixed LTR+RTL label refused, unassigned codepoint refused, pure RTL label accepted), and the TS suite gains the same cases if it does not already pin them.\n- No regression in the existing Python (32 tests) or TS suites.\n\n## Notes\n\n- Single-repo: `validate_crawl_url` / `_IDNA_DISALLOWED` exist only in `developing-today/code` (grep across the opencode / openchamber / nix clones: no copies). Not an mcpx set.\n- Related, distinct: #580 (A-label/punycode spelling of Arabic-Indic digits — an *encoded* form of an already-covered refusal), #531 (opposite direction: container over-refuses CONTEXTJ-valid ZWNJ/ZWJ). This issue is the remaining under-refusal: whole IDNA-validity classes neither validator check enumerates.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-22T11:25:31Z","url":"https://github.com/developing-today/code/issues/583"}
| 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:90321dd5-0b16-42b2-ee91-68f1d99879c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEF0:5F360:AD092F:DFD5A6:6B063731 |
| html-safe-nonce | 7ab7d268f91da6e5ca2d37ac4c8bc875ae13d9c91271b1c29d52adaf0b4d9f8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUYwOjVGMzYwOkFEMDkyRjpERkQ1QTY6NkIwNjM3MzEiLCJ2aXNpdG9yX2lkIjoiOTAzNDE4NjE5ODIwOTY3MzAwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fae9e511840828a90d5714d2fe406740a467b363474119aae7c6539a984c9e64 |
| hovercard-subject-tag | issue:5978379145 |
| 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/583/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d781340ce9bfc2512dc545247d834cf640dcae7e8a30cc1e8d1f2a65ee123f95/developing-today/code/issues/583 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d781340ce9bfc2512dc545247d834cf640dcae7e8a30cc1e8d1f2a65ee123f95/developing-today/code/issues/583 |
| og:image:alt | Summary The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) certifies hosts that are not valid IDNA/UTS-46 domain names at all — and that the Worker's validator re... |
| 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 | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| 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 | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| 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