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 blanket-refuses percent-encoded hosts the Worker validator decodes and accepts — public spellings (%65xample.com, 8%2e8%2e8%2e8) diverge, including as redirect targets · Issue #529 · developing-today/code

lab-ops-hub: container validator blanket-refuses percent-encoded hosts the Worker validator decodes and accepts — public spellings (%65xample.com, 8%2e8%2e8%2e8) diverge, including as redirect targets #529

New issue
Copy link
New issue
Copy link
Closed
#533
Closed
lab-ops-hub: container validator blanket-refuses percent-encoded hosts the Worker validator decodes and accepts — public spellings (%65xample.com, 8%2e8%2e8%2e8) diverge, including as redirect targets#529
#533
Copy link
Assignees
dezren39

Description

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

Summary

The two lab-ops-hub crawl validators disagree on percent-encoded hosts whose decoded form is public. The Worker validator (WHATWG URL) percent-decodes the host before judging it, so %65xample.com, example%2ecom and 8%2e8%2e8%2e8 are accepted as the public hosts they decode to. The container validator refuses every host containing % (the blanket fail-closed rule added for #505), including those public spellings — and including them as redirect targets, which the container validates raw with no Worker normalisation in between.

Evidence (verified 2026-10-21 on main b5757a66, both validators run directly)

Worker — pkgs/lab-ops-hub/src/lib.ts:130 validateCrawlUrl (via Node's WHATWG URL):

input host u.hostname verdict
%65xample.com example.com OK
example%2ecom example.com OK
8%2e8%2e8%2e8 8.8.8.8 OK
%6cocalhost localhost refused (decoded form judged)
127%2e0%2e0%2e1 127.0.0.1 refused

Container — pkgs/lab-ops-hub/container/app.py:114-116 (if "%" in host: raise … refusing to crawl percent-encoded host):

input host verdict
%65xample.com refused
example%2ecom refused
8%2e8%2e8%2e8 refused
%38%2e8.8.8 refused
%6cocalhost refused (correct outcome, via the blanket rule)

Why it matters

  • The validators are meant to hold the same policy independently (lib.ts:12: "The Python container crawler applies the same policy independently"). Every other divergence in this series (lab-ops-hub: container crawler treats invalid IPv4 spellings, numeric-final-label hosts and malformed ports as public DNS names #502, lab-ops-hub: container validator still allows bare 0x hosts (example.0x, 0x) that the Worker validator refuses #504, lab-ops-hub: container validator accepts space hosts and IPvFuture literals the Worker validator refuses #507, lab-ops-hub: container validator still allows DEL/C1-control, NBSP and WHATWG-forbidden (<>^|) hosts the Worker validator refuses #510, lab-ops-hub: both crawl validators accept double-trailing-dot and empty-label hosts (localhost.., example..com) — the #466 one-dot strip is defeated by a second dot #511, lab-ops-hub: both crawl validators accept impossible DNS names — labels over 63 chars and names over 253 chars #513, lab-ops-hub: container validator's overlong-name check counts characters, not IDNA-encoded length — IDN labels/names over the RFC 1035 limits still pass in Python while the Worker refuses them #517, lab-ops-hub: both crawl validators accept the RFC 9637 documentation range 3fff::/20 as a public crawl target #519, lab-ops-hub: container validator allows UTS-46/NFKC-mapped spellings of blocked targets — fullwidth localhost and unicode-dot IPv4 resolve to loopback/private #527) was treated as a bug to align, in whichever direction.
  • Direct /api/crawl submissions are masked by src/index.ts:368 (b.url = target.url — the Worker dispatches the normalised URL), but redirect targets are not: container/app.py:241-243 (_ValidatingRedirectHandler.redirect_request) validates the raw Location target, so a public page that 3xx-redirects to a percent-encoded public host crawls fine on the Worker-fallback path and 400s in the container, burning a container run and recording a spurious containerError before the fallback succeeds.
  • lab-ops-hub: container validator allows percent-encoded hosts (%6cocalhost, 127.0.0.1%09) and IPv6 zone ids that the Worker validator refuses #505's blanket refusal was the right fail-closed stopgap for decoded-blocked hosts (%6cocalhost, 127.0.0.1%09, IPv6 zone ids); the follow-up is to decode-and-judge like WHATWG instead of refusing the whole class.

Suggested fix / acceptance criteria

  • Container validator percent-decodes the host (valid %XX sequences, UTF-8) before the existing checks, mirroring WHATWG host parsing, instead of refusing on any %.
  • Decoded-blocked spellings stay refused: %6cocalhost → localhost, 127%2e0%2e0%2e1 → 127.0.0.1, foo%2elocalhost → foo.localhost, 127.0.0.1%09 (decodes to a forbidden tab character).
  • Invalid percent sequences (%zz, a trailing %) and IPv6 zone ids ([fe80::1%25eth0]) stay refused — WHATWG rejects both outright.
  • Decoded-public spellings are accepted in both validators: %65xample.com, example%2ecom, 8%2e8%2e8%2e8, %38%2e8.8.8.
  • A parity test pins these cases in both suites (test/lib.test.ts, test/test_container_validate.py), including at least one as a redirect target.
  • Note: judging the decoded form is not the same as fetching the raw spelling — urllib does not percent-decode hosts — so the fix should make the container fetch the decoded/normalised host (as the Worker does via target.url), not merely accept the raw URL.

Single-repo: validateCrawlUrl/validate_crawl_url exist only in this repo (checked the opencode, openchamber and nix clones — no copies).

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 22, 2026
  2. dezren39 commented on Oct 22, 2026

    @dezren39
    dezren39
    on Oct 22, 2026
    MemberAuthor
    More actions

    Fix in PR #533 (branch sweep/529-percent-encoded-host, commit 00de5b87).

    The container validator now percent-decodes the host before judging it (valid %XX escapes, UTF-8; invalid escapes, undecodable bytes, double-encoded spellings, decoded host delimiters and IPv6 zone ids refused at the decode step), runs the existing checks on the decoded form, and returns — and fetches — the URL with the decoded host substituted, in both the /crawl handler and the redirect handler.

    Verified: reproduced the divergence on main a8a3bf7e first (all four public spellings refused by the container, accepted by the Worker); 52-host differential probe against the Worker's validateCrawlUrl shows full verdict parity post-fix; npm test TS 25/25 + Python 22/22 with new parity tests in both suites (incl. a redirect target in each); ablation fails the new acceptance/redirect tests with only app.py reverted.

  3. dezren39
    added a commit that references this issue on Oct 22, 2026

    Merge pull request #533 from developing-today/sweep/529-percent-encod…

    06900e7
  4. dezren39
    closed this as completedin #533on Oct 22, 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

No labels
No labels

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.