Title: lab-ops-hub: container validator parses backslash authority differently from WHATWG (127.0.0.1\@example.com judged as example.com; example.com\@127.0.0.1 refused) · Issue #577 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator parses backslash authority differently from WHATWG (127.0.0.1\@example.com judged as example.com; example.com\@127.0.0.1 refused) · Issue #577 · developing-today/code
X Title: lab-ops-hub: container validator parses backslash authority differently from WHATWG (127.0.0.1\@example.com judged as example.com; example.com\@127.0.0.1 refused) · Issue #577 · developing-today/code
Description: Problem The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, line 62) parses the URL authority with urllib.parse.urlparse, which treats \ as an ordinary netloc character (part of the userinfo). The Worker...
Open Graph Description: Problem The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, line 62) parses the URL authority with urllib.parse.urlparse, which treats \ as an ordinary netloc char...
X Description: Problem The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, line 62) parses the URL authority with urllib.parse.urlparse, which treats \ as an ordinary netloc char...
Opengraph URL: https://github.com/developing-today/code/issues/577
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator parses backslash authority differently from WHATWG (127.0.0.1\\@example.com judged as example.com; example.com\\@127.0.0.1 refused)","articleBody":"## Problem\n\nThe container crawl validator (`pkgs/lab-ops-hub/container/app.py`, `validate_crawl_url`, line 62) parses the URL authority with `urllib.parse.urlparse`, which treats `\\` as an ordinary netloc character (part of the userinfo). The Worker's WHATWG URL parser treats `\\` as a path delimiter for special schemes (http/https), i.e. it **ends the authority**. The two validators therefore disagree about which host a backslash-spelled URL names — in both directions.\n\nVerified this run against current main (container validator imported directly; WHATWG via Node's `new URL`, inputs built with `chr(92)`/`String.fromCharCode(92)` so each URL contains exactly one backslash):\n\n| Input | WHATWG host (Worker judges) | urlparse host (container judges) | Result |\n|---|---|---|---|\n| `http://127.0.0.1\\@example.com/` | `127.0.0.1` | `example.com` | Worker refuses (non-public IPv4); container **accepts** |\n| `http://localhost\\@example.com/` | `localhost` | `example.com` | Worker refuses (blocked host); container **accepts** |\n| `http://example.com\\@127.0.0.1/` | `example.com` | `127.0.0.1` | Worker accepts; container **refuses** (non-public) |\n| `http:\\\\example.com/` | `example.com` | *(none)* | Worker accepts; container refuses \"url has no host\" |\n| `http:/\\example.com/` | `example.com` | *(none)* | Worker accepts; container refuses \"url has no host\" |\n\n## Why it matters\n\n- The container validator is the **only** judge for redirect targets: `container/app.py:401-407` re-validates every redirect `Location` with `validate_crawl_url` alone, and the container's own crawl endpoint validates with it independently (`app.py:498`). A validator that reads `127.0.0.1\\@example.com` as `example.com` certifies a URL whose WHATWG spelling names the loopback host — any WHATWG-semantics consumer of that certified URL (a future fetcher change, a proxy, a browser-side re-crawl) connects to a host this validator never judged. This is the same judge-the-host-that-gets-fetched invariant the #505/#529/#567 fixes established.\n- In the other direction, Worker-accepted crawl targets (`http://example.com\\@127.0.0.1/`, `http:\\\\example.com/`) are refused by the container, so the container fallback errors on URLs the primary path considers valid — an availability divergence of the same family as #571.\n\nNote the percent-encoded form `%5C` is data, not a delimiter, in both parsers and must stay judged as today; only a raw `\\` is structural.\n\n## Acceptance criteria\n\n- `validate_crawl_url` judges the host the WHATWG parser names for raw-backslash spellings: `http://127.0.0.1\\@example.com/` and `http://localhost\\@example.com/` are refused as non-public/blocked; `http://example.com\\@127.0.0.1/` is accepted as `example.com` (and the URL actually fetched names `example.com` — the returned/validated form must not hand the fetcher a spelling whose urlparse host differs from the judged host).\n- `http:\\\\example.com/` and `http:/\\example.com/` are handled the WHATWG way (host `example.com`) or explicitly refused with a test pinning the choice — but the two validators must not silently disagree.\n- New tests in `pkgs/lab-ops-hub/test/test_container_validate.py` cover the table above (Python suite stays green; TS suite untouched unless the fix changes Worker behavior).\n- Differential probe: a battery of backslash spellings (in host, userinfo, and authority-prefix positions) yields the same accept/refuse verdict and the same judged host in both validators.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-22T09:58:57Z","url":"https://github.com/developing-today/code/issues/577"}
| 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:5871c73b-919c-8bc2-37a7-d09a4bdaa1b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C408:3AABA8:B85F3F:F45DB4:6B063EAE |
| html-safe-nonce | 279e4fc3842584faac2805e7d6cd8ed0dda41390c7648f53005294a2989a46d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDA4OjNBQUJBODpCODVGM0Y6RjQ1REI0OjZCMDYzRUFFIiwidmlzaXRvcl9pZCI6IjYyNTAxMTIyMTcxMDc1NDU3NzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c3fb80556714b4f8932f8e4662094543dbfc7e9633633ed57622f3cff0e055c1 |
| hovercard-subject-tag | issue:5977150719 |
| 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/577/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7d04287173b5708fcf5aeb8448b7816524e6f6c2d544fbef87576590e829bab4/developing-today/code/issues/577 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7d04287173b5708fcf5aeb8448b7816524e6f6c2d544fbef87576590e829bab4/developing-today/code/issues/577 |
| og:image:alt | Problem The container crawl validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url, line 62) parses the URL authority with urllib.parse.urlparse, which treats \ as an ordinary netloc char... |
| 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