GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — lab-ops-hub container crawler accepts inet_aton IPv4 spellings (127.1, 2130706433, 0x7f.1) — loopback SSRF bypass in validate_crawl_url · Issue #468 · developing-today/code Closed DescriptionSummaryThe lab-ops-hub container crawler's Evidence (verified on main
|
| host spelling | validate_crawl_url |
fetch result |
|---|---|---|
127.0.0.1 |
refused | — (never fetched in the real flow) |
127.1 |
ACCEPTED | FETCHED 200 MARKER-LOOPBACK |
2130706433 |
ACCEPTED | FETCHED 200 MARKER-LOOPBACK |
0x7f000001 |
ACCEPTED | FETCHED 200 MARKER-LOOPBACK |
0177.0.0.1 |
ACCEPTED | FETCHED 200 MARKER-LOOPBACK |
Also accepted by the validator: 0x7f.1 (→ 127.0.0.1) and 2852039166 (→ 169.254.169.254, the cloud metadata address). socket.getaddrinfo confirms each spelling resolves to the non-public address shown. Redirect targets are affected identically: _ValidatingRedirectHandler.redirect_request calls the same validate_crawl_url.
The container is the primary crawler (the Worker fallback is only a fallback) and it fetches from inside the container's network position. A caller who can request a crawl (or a public page that redirects into one of these spellings) can reach loopback and link-local services of that environment, bypassing the #441 policy the Worker side enforces. The two validators are documented as applying "the same policy independently" — they currently diverge on exactly the spellings attackers reach for first.
validate_crawl_url refuses every host spelling the resolver would interpret as a non-global IPv4 address — at minimum the short, integer, hex, and octal forms of 127.0.0.1, 10/8, 172.16/12, 192.168/16, 169.254/16, 100.64/10 — for both direct crawl URLs and redirect targets.example.com, 8.8.8.8, [2606:4700:4700::1111]).container/app.py (the suite in test/lib.test.ts exercises only the TypeScript copy). Add a runnable test for validate_crawl_url covering the spelling matrix above.Suggested fix shape: in the except ValueError branch, before treating the host as a DNS name, try an inet_aton-style parse (e.g. socket.inet_aton) when the host consists solely of numeric labels (decimal/octal/hex) — if it parses as IPv4, judge that address with is_global exactly like the dotted-quad path; only fall through to "DNS name" when it does not parse as an IP in any spelling.
Single-repo: the lab-ops-hub package (both validators) exists only in developing-today/code; no copy exists in opencode, openchamber, or dezren39/nix.