Title: lab-ops-hub: PR #533 decode-and-judge bypass — percent-encoded fullwidth delimiters NFKC-map into host delimiters after the decode check, so the container fetches unjudged private hosts (localhost / 127.0.0.1 / 192.168.0.1) · Issue #567 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: PR #533 decode-and-judge bypass — percent-encoded fullwidth delimiters NFKC-map into host delimiters after the decode check, so the container fetches unjudged private hosts (localhost / 127.0.0.1 / 192.168.0.1) · Issue #567 · developing-today/code
X Title: lab-ops-hub: PR #533 decode-and-judge bypass — percent-encoded fullwidth delimiters NFKC-map into host delimiters after the decode check, so the container fetches unjudged private hosts (localhost / 127.0.0.1 / 192.168.0.1) · Issue #567 · developing-today/code
Description: Finding PR #533 (merge 06900e7c, commit 00de5b87) replaced the container crawl validator's blanket refusal of % hosts with decode-and-judge — but the delimiter check runs on the percent-decoded form before NFKC mapping, so a percent-enco...
Open Graph Description: Finding PR #533 (merge 06900e7c, commit 00de5b87) replaced the container crawl validator's blanket refusal of % hosts with decode-and-judge — but the delimiter check runs on the percent-decoded for...
X Description: Finding PR #533 (merge 06900e7c, commit 00de5b87) replaced the container crawl validator's blanket refusal of % hosts with decode-and-judge — but the delimiter check runs on the percent-decoded...
Opengraph URL: https://github.com/developing-today/code/issues/567
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: PR #533 decode-and-judge bypass — percent-encoded fullwidth delimiters NFKC-map into host delimiters after the decode check, so the container fetches unjudged private hosts (localhost / 127.0.0.1 / 192.168.0.1)","articleBody":"## Finding\n\nPR #533 (merge `06900e7c`, commit `00de5b87`) replaced the container crawl validator's blanket refusal of `%` hosts with decode-and-judge — but the delimiter check runs on the percent-decoded form **before** NFKC mapping, so a percent-encoded character whose NFKC mapping *is* a host delimiter escapes the check, is spliced into the returned URL, and makes the fetcher connect to a host that was never judged — including `localhost`, `127.0.0.1` and `192.168.0.1`.\n\n## Evidence\n\nIn `pkgs/lab-ops-hub/container/app.py` on current main (`87624089`):\n\n- `_percent_decode_host` (line ~271) refuses a decoded `%` and any decoded character in `#/:?@[\\]`.\n- `validate_crawl_url` then NFKC-normalizes the decoded host (`unicodedata.normalize(\"NFKC\", host).lower()`, line ~118) and runs the remaining checks on the mapped form — but no check after mapping refuses `/ \\ : ? @ # [ ]` or a mapped `%`. The forbidden-character check only covers controls/space, `0x7F–0xA0`, `\u003c>^|` and `_IDNA_DISALLOWED`.\n- Raw fullwidth spellings cannot reach this state: `urlparse` raises `ValueError` (\"netloc … contains invalid characters under NFKC normalization\") — verified this review: raw `http://127.0.0.1/example.com/` is BLOCKED. The percent-encoded spelling (`%ef%bc%8f` = UTF-8 for U+FF0F FULLWIDTH SOLIDUS) is pure ASCII in the raw netloc, so that guard never fires.\n\nVerified by driving both real validators from a `git archive` snapshot of current main:\n\n| URL | Container (Python) | Worker (TS / WHATWG) |\n| --- | --- | --- |\n| `http://localhost%ef%bc%8fexample.com/` | **ALLOW → returns `http://localhost/example.com/` (fetcher host: `localhost`)** | BLOCK \"url is not a valid URL\" |\n| `http://127.0.0.1%ef%bc%8fexample.com/` | **ALLOW → returns `http://127.0.0.1/example.com/`** | BLOCK |\n| `http://192.168.0.1%ef%bc%8fadmin/` | **ALLOW → returns `http://192.168.0.1/admin/`** | BLOCK |\n| `http://exam%ef%bc%8fple.com/` (U+FF0F→`/`) | ALLOW → `http://exam/ple.com/` | BLOCK |\n| `http://exam%ef%bc%9aple.com/` (U+FF1A→`:`) | ALLOW → `http://exam:ple.com/` | BLOCK |\n| `http://exam%ef%bc%a0ple.com/` (U+FF20→`@`) | ALLOW → `http://exam@ple.com/` | BLOCK |\n| `http://exam%ef%bc%83ple.com/` (U+FF03→`#`), `%ef%bc%9f` (`?`), `%ef%bc%bc` (`\\`), `%ef%bc%bb/%bd` (`[`,`]`) | ALLOW, delimiter spliced into returned URL | BLOCK |\n| `http://example%ef%bc%85com/` (U+FF05→`%`) | ALLOW → `http://example%com/` (a `%` the decode step guarantees cannot survive) | BLOCK |\n| `http://%e2%84%80.com/` (U+2100 ℀, NFKC expands to `a/c`) | ALLOW → `http://a/c.com/` | BLOCK |\n\nControls behave as PR #533 intended: `%65xample.com` and `8%2e8%2e8%2e8` ALLOW in both, `%6cocalhost` BLOCK in both, ASCII delimiters (`%2f`, `%5c`, `%3a`) BLOCK in Python at the decode step.\n\nThe exposed path is redirects: `_ValidatingRedirectHandler` validates the raw `Location` with no Worker normalisation in between (PR #533's own framing), and `_url_with_host` returns the mapped host spliced into the URL — so a public page can 302 the container to `http://192.168.0.1%ef%bc%8fadmin/` and the container fetches the private host. This also breaks PR #533's own guarantee that the crawler fetches \"the decoded host that was judged\".\n\nCurrent-main suites pass (TS 25/25, Python 22/22, re-run this review) — the battery pins ASCII decoded delimiters only; no percent-encoded compatibility/fullwidth delimiter case exists in either suite.\n\n## Why it matters\n\nThis is an SSRF-policy bypass in the component that actually fetches, introduced by the merged PR that set out to fix validator parity (#529): the Worker refuses these spellings outright while the container now accepts and fetches an unjudged, possibly private, target — the same failure shape as #468 and the #505 blanket refusal this PR superseded.\n\n## Acceptance criteria\n\n- The container refuses every percent-encoded spelling whose decoded **and NFKC-mapped** form contains a host delimiter (`% # / : ? @ [ \\ ]` and the rest of the WHATWG forbidden-host set) — e.g. by re-checking structural characters on the fully mapped form, or refusing decoded codepoints whose NFKC mapping introduces one.\n- Verdict parity with the Worker on a shared battery including at least: U+FF0F, U+FF1A, U+FF20, U+FF03, U+FF1F, U+FF3C, U+FF05 and U+2100 cases, plus `localhost` / `127.0.0.1` / `192.168.0.1` + `%ef%bc%8f` spellings.\n- For every accepted percent-encoded URL, re-parsing the returned URL yields exactly the host that was judged (asserted in tests).\n- Regression tests in `test_container_validate.py` (including a redirect-handler refusal for a percent-encoded fullwidth-delimiter target) and, where the vector format allows, `lib.test.ts`.\n- Existing suites still pass (TS 25/25, Python 22/22 plus the new tests).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-22T06:48:50Z","url":"https://github.com/developing-today/code/issues/567"}
| 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:f4b5c104-588c-4fd4-1e9b-75c516f67e24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C250:C5B62:AD40DB:E8CB10:6B064239 |
| html-safe-nonce | 98b68d69bc1c8dea64f5bfee7a60df7a6b21623cf6182c937d1e27afb1f115a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjUwOkM1QjYyOkFENDBEQjpFOENCMTA6NkIwNjQyMzkiLCJ2aXNpdG9yX2lkIjoiNzE5MzM3NjIzMTY3MDMyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ec203fda0364a49f0b8b760c83b040cf2c296c1d72ee9da02267c1686738f5f5 |
| hovercard-subject-tag | issue:5974513064 |
| 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/567/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e82e1fbbc388139be5be80192e77e2aeea5cb10c2a6de881fee03569d7ef245f/developing-today/code/issues/567 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e82e1fbbc388139be5be80192e77e2aeea5cb10c2a6de881fee03569d7ef245f/developing-today/code/issues/567 |
| og:image:alt | Finding PR #533 (merge 06900e7c, commit 00de5b87) replaced the container crawl validator's blanket refusal of % hosts with decode-and-judge — but the delimiter check runs on the percent-decoded for... |
| 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 | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| 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 | ac613d3698d3d8565651455086e1f74da07bf277 |
| 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