Title: lab-ops-hub: container validator returns WHATWG-encodable ASCII punctuation verbatim outside the host — path/query/fragment/userinfo " < > ^ ` { } go on the request line raw while the Worker fetches the encoded form · Issue #618 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator returns WHATWG-encodable ASCII punctuation verbatim outside the host — path/query/fragment/userinfo " < > ^ ` { } go on the request line raw while the Worker fetches the encoded form · Issue #618 · developing-today/code
X Title: lab-ops-hub: container validator returns WHATWG-encodable ASCII punctuation verbatim outside the host — path/query/fragment/userinfo " < > ^ ` { } go on the request line raw while the Worker fetches the encoded form · Issue #618 · developing-today/code
Description: Summary The container validator's returned-URL encoder (_encode_url_component, pkgs/lab-ops-hub/container/app.py:663) claims in its comment to encode "the way WHATWG's URL serializer encodes the userinfo, path, query and fragment compone...
Open Graph Description: Summary The container validator's returned-URL encoder (_encode_url_component, pkgs/lab-ops-hub/container/app.py:663) claims in its comment to encode "the way WHATWG's URL serializer encodes the us...
X Description: Summary The container validator's returned-URL encoder (_encode_url_component, pkgs/lab-ops-hub/container/app.py:663) claims in its comment to encode "the way WHATWG's URL serializer e...
Opengraph URL: https://github.com/developing-today/code/issues/618
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator returns WHATWG-encodable ASCII punctuation verbatim outside the host — path/query/fragment/userinfo \" \u003c > ^ ` { } go on the request line raw while the Worker fetches the encoded form","articleBody":"## Summary\n\nThe container validator's returned-URL encoder (`_encode_url_component`, `pkgs/lab-ops-hub/container/app.py:663`) claims in its comment to encode \"the way WHATWG's URL serializer encodes the userinfo, path, query and fragment components\", but it only encodes non-ASCII characters (#615) and C0 controls / space / DEL (#614). The ASCII punctuation in WHATWG's per-component percent-encode sets passes through verbatim, so for URLs both validators accept, the container fetches a different (raw) spelling than the Worker fetches (its encoded form).\n\n## Evidence (verified 2026-10-22, current main 23eefe17)\n\n`validate_crawl_url` (Python) vs `new URL(...).toString()` (the Worker's serializer, Node 24):\n\n| Input | Container returns | Worker returns |\n|---|---|---|\n| `http://example.com/a\"b` | `http://example.com/a\"b` | `http://example.com/a%22b` |\n| `http://example.com/a\u003cb>c` | `http://example.com/a\u003cb>c` | `http://example.com/a%3Cb%3Ec` |\n| `http://example.com/a` + backtick + `b` | raw backtick | `a%60b` |\n| `http://example.com/a{b}c` | `http://example.com/a{b}c` | `http://example.com/a%7Bb%7Dc` |\n| `http://example.com/a^b` | `http://example.com/a^b` | `http://example.com/a%5Eb` |\n| `http://example.com/?q=a\"b\u003cc` | raw | `?q=a%22b%3Cc` |\n| `http://example.com/#a\"b\u003cc>` + backtick + `d` | raw | `#a%22b%3Cc%3E%60d` |\n| `http://us\"er@example.com/` | `http://us\"er@example.com/` | `http://us%22er@example.com/` |\n\nA per-character probe of the WHATWG serializer gives the exact sets (on top of the already-encoded non-ASCII / C0 / space / DEL):\n\n- **path**: `\"` `\u003c` `>` `^` `` ` `` `{` `}`\n- **query**: `\"` `\u003c` `>` (note: backtick, `^`, `{`, `}` stay raw in query)\n- **fragment**: `\"` `\u003c` `>` `` ` ``\n- **userinfo**: `\"` `;` `\u003c` `=` `>` `@` `[` `]` `^` `` ` `` `{` `|` `}` (the delimiter characters `/ : ? # \\` never survive urlparse into the userinfo, so they need no arm)\n\nThe sets are per-component: a single shared set would over-encode the query (e.g. a raw backtick in a query is exactly what the Worker fetches) and under-encode the userinfo.\n\n## Why it matters\n\n- The URL `validate_crawl_url` returns is the URL the fetcher fetches (`container/app.py:785`, `urllib.request.Request`). Raw `\"`, `\u003c`, `>` etc. go onto the request line unencoded: `http.client` only rejects C0/space/DEL (`_contains_disallowed_url_pchar_re`), so these sail through to the origin, where servers and intermediaries commonly reject a raw `\"`/`\u003c`/`>` in the request target with 400 — or parse it differently — while the Worker fetches the encoded form of the same validated URL successfully. Same validated target, different crawl outcome per backend: the #614/#615 divergence class, one character class later.\n- The comment on `_encode_url_component` overstates what the function does, which is how this residual stayed invisible through two fixes in this exact spot.\n\n## Acceptance criteria\n\n- `_url_with_encoded_components` percent-encodes the per-component WHATWG sets above in userinfo, path, query and fragment, in addition to the existing non-ASCII / C0 / space / DEL encoding; existing `%XX` sequences are never double-encoded.\n- The query component is NOT encoded with the path set (backtick / `^` / `{` / `}` in a query stay raw, matching the Worker byte-for-byte).\n- New tests in `test/test_container_validate.py` pin the table above (path, query, fragment, userinfo arms), and the existing differential/parity tests still pass.\n- Python suite (`test_container_validate.py`) and TS suite (`lib.test.ts`) both green.\n\n## Suggested fix\n\nGive `_encode_url_component` a per-component extra-set parameter (path / query / fragment / userinfo sets as probed above) and pass the matching set from each call site in `_url_with_encoded_components`; update the function's comment to name the sets it implements.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T00:17:36Z","url":"https://github.com/developing-today/code/issues/618"}
| 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:8cdcdeeb-3764-c70c-3f8d-52d4ee52b7a8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9FCC:1725D9:113FB70:17D144B:6B06B63B |
| html-safe-nonce | fb7e1aa91784ad7bc339f8895315183fe33a0dda57be08fafb06251dd40372fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkNDOjE3MjVEOToxMTNGQjcwOjE3RDE0NEI6NkIwNkI2M0IiLCJ2aXNpdG9yX2lkIjoiOTk5MjkzOTU3OTAzMzk4NDU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 58bba96ea94ccb8a5597bc1127d927e1ff377164dcc20319b7536ea88f0609e8 |
| hovercard-subject-tag | issue:5989586858 |
| 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/618/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b1cd312af82a0911dc425db1fbdf8409b619cab660baada4c0b99538253dd0dc/developing-today/code/issues/618 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b1cd312af82a0911dc425db1fbdf8409b619cab660baada4c0b99538253dd0dc/developing-today/code/issues/618 |
| og:image:alt | Summary The container validator's returned-URL encoder (_encode_url_component, pkgs/lab-ops-hub/container/app.py:663) claims in its comment to encode "the way WHATWG's URL serializer encodes the us... |
| 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 | 9b2b1f32e21f9e529372294897d423fa443a20a3a37bafa95dec0f213469ebfc |
| 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 | 5402de66059e5821fab003de929c7056c92d863f |
| 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