GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lab-ops-hub: container validator returns C0 controls, space and DEL verbatim outside the host — fetcher raises InvalidURL on URLs both validators accept (PR #612 residual) · Issue #614 · developing-today/code

lab-ops-hub: container validator returns C0 controls, space and DEL verbatim outside the host — fetcher raises InvalidURL on URLs both validators accept (PR #612 residual) #614

New issue
Copy link
New issue
Copy link
Closed
#617
Closed
lab-ops-hub: container validator returns C0 controls, space and DEL verbatim outside the host — fetcher raises InvalidURL on URLs both validators accept (PR #612 residual)#614
#617
Copy link
Assignees
dezren39
Labels
app/lab-ops-hubPackage/app: lab-ops-hub (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 22, 2026
Issue body actions

Problem

PR #612 (fixing #611) made the container validator (pkgs/lab-ops-hub/container/app.py, validate_crawl_url) strip ASCII tab/LF/CR before judging, so the returned URL no longer carries those three controls. The rest of the C0 range (U+0000–U+0008, U+000B, U+000C, U+000E–U+001F), plus space and DEL, are still returned verbatim everywhere outside the host, and the container fetcher then chokes on them:

  • WHATWG URL parsing (the Worker's validateCrawlUrl in src/lib.ts, via new URL) trims leading/trailing C0-control-or-space from the input and percent-encodes C0 controls, space and DEL inside the path/query/fragment. It returns a clean serialized URL.
  • The container validator accepts the same spellings (its host checks never see path/query characters, and urlparse tolerates the leading forms for judging) but returns the raw string. _fetch_crawl hands it to urllib/http.client, which raises InvalidURL ("URL can't contain control characters") for controls/space/DEL in the request target, or URLError ("unknown url type") for a leading C0 the parser doesn't strip — so do_POST surfaces a 502 for a URL both validators accepted, instead of the crawl result the Worker path produces.

This is the same judge-vs-fetch family as #611/#577: the validator certifies one string and the fetcher is handed another, unusable one. It is acceptance-side only — no verdict divergence and no SSRF direction: blocked hosts wrapped in these controls are still refused by both validators (verified in the battery below).

Evidence (reproduced on current main d93f430, merge of PR #612, 2026-10-22)

Differential battery through both real validators (container validate_crawl_url vs Worker validateCrawlUrl under Bun): every C0 control U+0000–U+0020 plus U+007F in 9 positions (path mid/end, query mid/end, fragment, leading, trailing, leading-on-private, host-end) = 306 cases, plus tab/CR/LF inserted at every position of 20 base URLs = 2,323 cases. Verdicts agree on all 2,629 cases (tab/CR/LF parity from #612 confirmed, including slash-run and split-private forms). The returned URL diverges in 216 of the 306 C0 cases, e.g.:

'http://example.com/pa\x00th'   container returns 'http://example.com/pa\x00th'   Worker returns 'http://example.com/pa%00th'
'http://example.com/pa th'      container returns 'http://example.com/pa th'      Worker returns 'http://example.com/pa%20th'
'http://example.com/?q=a\x7fb'  container returns 'http://example.com/?q=a\x7fb'  Worker returns 'http://example.com/?q=a%7Fb'
'\x00http://example.com/'       container returns '\x00http://example.com/'       Worker returns 'http://example.com/'
'http://example.com/\x00'       container returns 'http://example.com/\x00'       Worker returns 'http://example.com/'

Fetcher consequence, verified with the container's own _fetch_crawl against a local HTTP server (host swapped to the test server, control positions preserved):

'http://<srv>/pa\x00th'   -> InvalidURL: URL can't contain control characters. '/pa\x00th'
'http://<srv>/pa\x01th'   -> InvalidURL (same)
'http://<srv>/pa th'      -> InvalidURL (same, found ' ')
'http://<srv>/pa\x7fth'   -> InvalidURL (same)
'http://<srv>/?q=a\x00b'  -> InvalidURL (same)
'\x00http://<srv>/'       -> URLError: unknown url type
'\x01http://<srv>/'       -> URLError: unknown url type
'http://<srv>/\x00'       -> InvalidURL (same)

(In do_POST these exceptions land in the outer handler and become a 502, per #572's plumbing — a crawl failure, not a result.)

Pre-existing returned-URL differences that are not part of this finding (both fetch fine): the container returns the original IDN spelling (http://münchen.de/ vs the Worker's punycode form) and keeps an explicit default port (:80), by design in the existing code comments.

Why it matters

validate_crawl_url's contract is judge-what-you-fetch, and #612 just extended that contract to the full URL string for tab/CR/LF. Any crawl target whose path or query carries a raw control, space or DEL — pasted URLs, redirect Locations built from user data (the redirect handler validates through the same function), generated links — is accepted by the container validator and then fails the fetch with a 502, while the Worker fallback fetches the WHATWG-normalized form successfully. The two crawlers disagree on the outcome for a class of otherwise-legitimate public URLs.

Acceptance criteria

  • For every input both validators accept, the URL validate_crawl_url returns contains no raw C0 control (U+0000–U+001F), space, or DEL outside the host — it is either normalized the way WHATWG serializes it (leading/trailing C0/space trimmed; path/query/fragment controls, space and DEL percent-encoded) or the spelling is refused up front with a clear error. Either resolution is acceptable; silently returning a fetcher-breaking string is not.
  • Verdict parity is preserved: spellings refused today (blocked hosts wrapped in these characters, controls inside the host) stay refused, and no currently-accepted public target changes verdict except as needed for the bullet above.
  • Python tests pin the headline cases (path-mid NUL/space/DEL, query-mid NUL, leading NUL, trailing NUL) against the chosen behavior, and the TS suite pins the Worker's returned form for the same inputs.
  • A differential run over the C0 battery (U+0000–U+0020 + U+007F × path/query/fragment/leading/trailing positions) shows verdict parity and no raw-control returned URLs from the container validator.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 22, 2026
  2. dezren39
    added a commit that references this issue on Oct 23, 2026

    Merge pull request #617 from developing-today/sweep/614-c0-space-del-…

    23eefe1
  3. dezren39
    closed this as completedin #617on Oct 23, 2026
  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 24, 2026 – with developing.today fleet
    Contributor
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #617 — lab-ops-hub: percent-encode C0 controls, space and DEL outside the host in the container validator (#614) (merged 2026-10-23)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  5. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/lab-ops-hubPackage/app: lab-ops-hub (pkgs/ or apps/ in this repo)
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/lab-ops-hubPackage/app: lab-ops-hub (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.