Title: lab-ops-hub: PR #523's container length check measures raw punycode, not the UTS-46-mapped form — mapped IDN labels still diverge from the Worker in both directions · Issue #526 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: PR #523's container length check measures raw punycode, not the UTS-46-mapped form — mapped IDN labels still diverge from the Worker in both directions · Issue #526 · developing-today/code
X Title: lab-ops-hub: PR #523's container length check measures raw punycode, not the UTS-46-mapped form — mapped IDN labels still diverge from the Worker in both directions · Issue #526 · developing-today/code
Description: Summary PR #523 fixed #517 by making the container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, lines 73–82 on main 1d0de449) judge DNS length limits on an "encoded" form — but the encoding it uses is Python's raw pu...
Open Graph Description: Summary PR #523 fixed #517 by making the container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, lines 73–82 on main 1d0de449) judge DNS length limits on an "encoded" form — but...
X Description: Summary PR #523 fixed #517 by making the container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, lines 73–82 on main 1d0de449) judge DNS length limits on an "encoded" ...
Opengraph URL: https://github.com/developing-today/code/issues/526
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: PR #523's container length check measures raw punycode, not the UTS-46-mapped form — mapped IDN labels still diverge from the Worker in both directions","articleBody":"## Summary\n\nPR #523 fixed #517 by making the container validator (`pkgs/lab-ops-hub/container/app.py`, `validate_crawl_url`, lines 73–82 on main `1d0de449`) judge DNS length limits on an \"encoded\" form — but the encoding it uses is Python's raw `punycode` codec:\n\n```python\nencoded_labels = [\n label if label.isascii() else \"xn--\" + label.encode(\"punycode\").decode(\"ascii\")\n for label in host.split(\".\")\n]\n```\n\nRaw punycode is not IDNA. The Worker's `u.hostname` — the form the container is trying to match — is the result of WHATWG/UTS-46 processing, which **maps and normalizes each label before punycode-encoding it** (case/width mapping, NFKC compatibility decomposition, and dropping mapped-to-empty codepoints). Where mapping changes a label's length, the two validators still disagree about the RFC 1035 limits — in both directions.\n\n## Evidence\n\nVerified on current main `1d0de449` (PR #523, commit `eac17571`) by driving both real validators (`container/app.py` from main and `validateCrawlUrl` from `src/lib.ts` via `node --experimental-transform-types`):\n\n| Host label | Container (Python) | Worker (TS) |\n| --- | --- | --- |\n| `\"\\ufdfa\" × 4` + `.com` (U+FDFA ARABIC LIGATURE U+FDFA) | **ACCEPT** (raw punycode label is 11 chars) | REFUSE — `new URL` itself rejects it: UTS-46 NFKC-expands U+FDFA to a long Arabic phrase, whose A-label exceeds 63 |\n| `\"\\uff41\" × 60` + `.com` (fullwidth a) | **REFUSE** as overlong (raw punycode label is 67 chars) | ACCEPT — UTS-46 maps fullwidth a to ASCII `a`, hostname label is exactly 60 |\n| `\"a\" × 60 + U+00AD × 10` + `.com` (soft hyphens) | **REFUSE** as overlong (raw punycode label is 77 chars) | ACCEPT — U+00AD is mapped to empty in UTS-46 processing, hostname label is exactly 60 |\n\nControls agree on both sides: the #517 CJK cases (42-char label refused by both, 40-char label accepted by both) and an ordinary IDN host (`examéple.com`) are unchanged.\n\nThe same `encoded_labels` list also feeds the joined 253-char name check (app.py:79), so the name limit has the same divergence, not just the per-label limit.\n\n## Why it matters\n\nThis is the #517 failure mode one layer down: the container is the defence-in-depth re-check on the component that actually fetches (#441), so where the validators disagree the effective policy is wrong in one direction or the other — the container either certifies a name the fetcher's IDNA step will fail on deep inside the crawl (U+FDFA case; Python's own `encodings.idna` also errors \"label empty or too long\" for it), or refuses a perfectly valid public name the Worker already accepted (fullwidth / soft-hyphen cases — a false refusal of a legitimate crawl target). PR #523's differential probe covered ASCII and CJK hosts only, neither of which is affected by UTS-46 mapping, so the gap survived its parity check.\n\nRelated but distinct from #516 (open): that issue covers IDNA-**disallowed** codepoints the container allows at any length. This issue is about the **length judgement** using the un-mapped form; the fullwidth and soft-hyphen cases are false refusals, the opposite direction from every previous parity issue, and #516's acceptance criteria do not cover them. A fix that processes each label with real UTS-46/IDNA mapping before measuring (rather than the raw `punycode` codec) would likely serve both issues — worth coordinating — but the length cases need their own tests either way. Note Python's stdlib `encodings.idna` is IDNA 2003, whose mapping differs from UTS-46 in places (e.g. ß), so its output needs comparing against the WHATWG result before relying on it (#516 makes the same caution).\n\nCross-repo: this validator pair lives only in developing-today/code (checked: no `lab-ops-hub`/`validate_crawl_url` in the opencode, openchamber or nix clones) — single-repo issue.\n\n## Acceptance criteria\n\n- `validate_crawl_url`'s length checks judge the UTS-46/IDNA-processed form of each label (mapping + normalization applied before punycode), so its overlong verdicts match the Worker's on mapped labels, not just on ASCII/CJK ones.\n- The three evidence hosts above get matching verdicts from both validators: U+FDFA×4 refused up front by the container with the overlong/invalid-name error; fullwidth-a×60 and `\"a\"×60 + U+00AD×10` accepted by both.\n- Regression tests in `pkgs/lab-ops-hub/test/test_container_validate.py` cover at least one mapping-expands case and one mapping-shrinks case, and fail with only `container/app.py`'s length check reverted to the raw-punycode form (ablation).\n- The #517 cases stay pinned: CJK 42-char label refused, 40-char label (61 encoded) accepted, ASCII at/over-limit behaviour unchanged.\n- A differential probe over a battery including compatibility-mapped, width-mapped and mapped-to-empty characters (label and full-name lengths) shows full TS/Python parity.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-22T03:01:46Z","url":"https://github.com/developing-today/code/issues/526"}
| 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:2a8c2ddf-6ab0-a825-44d2-d84f2bcf6968 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 941A:1B0DA8:A5BF4D:D7CD09:6B063658 |
| html-safe-nonce | 36d00c3f853922ff3570c09abf286b1a079403327c37949694e5c98fead830c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDFBOjFCMERBODpBNUJGNEQ6RDdDRDA5OjZCMDYzNjU4IiwidmlzaXRvcl9pZCI6IjQyNzc2NTU1OTQ1OTA0MTg1MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0671a3738d5c2f241292fa4f3c9f08783f16e680620d025f4c46665684d746be |
| hovercard-subject-tag | issue:5972247953 |
| 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/526/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e942aa7f4adfeb9e312d49ad7c4b22e6bb160e14f6c51138906071cc3fbbe371/developing-today/code/issues/526 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e942aa7f4adfeb9e312d49ad7c4b22e6bb160e14f6c51138906071cc3fbbe371/developing-today/code/issues/526 |
| og:image:alt | Summary PR #523 fixed #517 by making the container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, lines 73–82 on main 1d0de449) judge DNS length limits on an "encoded" form — but... |
| 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