Title: 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 · Issue #511 · developing-today/code · GitHub
Open Graph Title: 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 · Issue #511 · developing-today/code
X Title: 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 · Issue #511 · developing-today/code
Description: Summary Both lab-ops-hub crawl validators strip exactly one trailing dot before the blocked-host checks (#466), so a second trailing dot — or any empty label — defeats those checks, and the malformed name falls through and is certified a...
Open Graph Description: Summary Both lab-ops-hub crawl validators strip exactly one trailing dot before the blocked-host checks (#466), so a second trailing dot — or any empty label — defeats those checks, and the malform...
X Description: Summary Both lab-ops-hub crawl validators strip exactly one trailing dot before the blocked-host checks (#466), so a second trailing dot — or any empty label — defeats those checks, and the malform...
Opengraph URL: https://github.com/developing-today/code/issues/511
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"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","articleBody":"## Summary\n\nBoth lab-ops-hub crawl validators strip exactly **one** trailing dot before the blocked-host checks (#466), so a second trailing dot — or any empty label — defeats those checks, and the malformed name falls through and is certified as \"a public DNS name\" by both sides:\n\n| Host form | TS Worker `validateCrawlUrl` | Python container `validate_crawl_url` |\n| --- | --- | --- |\n| `http://localhost../` | **ALLOW** | **ALLOW** |\n| `http://127.0.0.1../` | **ALLOW** | **ALLOW** |\n| `http://foo.localhost../` | **ALLOW** | **ALLOW** |\n| `http://example..com/` (empty interior label) | **ALLOW** | **ALLOW** |\n| `http://.example.com/` (empty first label) | **ALLOW** | **ALLOW** |\n\nControls, identical on both sides (must not change): `http://localhost./` BLOCK, `http://foo.localhost./` BLOCK, `http://example.com./` ALLOW, ordinary public names ALLOW.\n\n## Evidence\n\n- Verified on main `42bc02d9` by driving both real validators over the same battery (TS via bun importing `pkgs/lab-ops-hub/src/lib.ts`, Python by importing `pkgs/lab-ops-hub/container/app.py`): every form in the table above is ALLOW on both sides.\n- TS: `pkgs/lab-ops-hub/src/lib.ts` — `const host = rawHost.endsWith(\".\") ? rawHost.slice(0, -1) : rawHost;` strips one dot; `\"localhost..\"` becomes `\"localhost.\"`, which is neither `localhost` nor ends with a blocked suffix, and `\"127.0.0.1.\"` is not recognised as an IPv4 literal, so both pass. WHATWG keeps the hostname verbatim: `new URL(\"http://localhost../\").hostname === \"localhost..\"`.\n- Python: `pkgs/lab-ops-hub/container/app.py` `validate_crawl_url` — `if host.endswith(\".\"): host = host[:-1]` is the same one-dot strip; the stripped `\"localhost.\"` / `\"127.0.0.1.\"` then misses the localhost check, `ipaddress` rejects the dotted string, `_inet_aton_ipv4` returns None, the final label (`\"\"` after the second dot / `\"1.\"` forms) is not numeric, and the function returns the URL as \"a public DNS name\".\n- An empty label (`..` anywhere, or a leading `.`) is not a valid DNS name at all: glibc's resolver rejects these spellings outright (`getaddrinfo(\"localhost..\")` → \"label empty or too long\", verified locally for `localhost..`, `127.0.0.1..`, `example.com..`). Resolver leniency for trailing dots varies by platform (the container fetcher, the Worker's fetch resolver, and user-agent resolvers do not all share glibc's behaviour), so the guard's verdict should not depend on it.\n\n## Why it matters\n\nThe validators are the SSRF guard for the crawler (#441), and their stated rule is that only well-formed public targets pass. #466 closed the single-trailing-dot evasion (`localhost.` is `localhost`), but the same evasion with a second dot re-opens the spelling class the fix was meant to close, and the empty-label forms show the underlying gap: neither validator ever checks that the host is a structurally valid DNS name before certifying it as a public one. Where a resolver is lenient about trailing dots, `localhost..` / `foo.localhost..` reach the local target the guard exists to refuse; where it is strict, the crawl dies in the resolver with a low-level error instead of a clear guard verdict — the same \"verdict meaningless\" failure #507/#510 record for other host forms.\n\nCross-repo note: this validator pair lives only in developing-today/code (`validateCrawlUrl`/`validate_crawl_url` have no twin in the opencode, openchamber or dezren39/nix clones), so this is a single-repo issue. Distinct from open #510, which covers forbidden *characters* (DEL/C1/NBSP/`\u003c>^|`) in the container validator only; this issue is about label *structure* and affects both validators identically.\n\n## Acceptance criteria\n\n- Both validators refuse a host with an empty label — a second trailing dot (`localhost..`, `127.0.0.1..`, `foo.localhost..`, `example.com..`), an interior empty label (`example..com`), or a leading dot (`.example.com`) — up front with a clear validator error.\n- Controls unchanged: `localhost.` / `foo.localhost.` still BLOCK, `example.com.` (single root dot on a public name) and ordinary public names / valid IP literals still ALLOW on both sides.\n- Regression tests in both suites (`pkgs/lab-ops-hub/test/` TS tests and `test_container_validate.py`) cover each refused class, and fail with only the validator change reverted (ablation).\n- The Python and TS validators agree on the full battery above.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-21T22:43:48Z","url":"https://github.com/developing-today/code/issues/511"}
| 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:19352edc-edcb-fc25-cc54-d503960ce451 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C676:20AEB3:6E8D5D:942945:6B062DC4 |
| html-safe-nonce | 83e324c4f3c86e4cc30e8690f247f35a3048b2253201e35a35c32683f0d3f698 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjc2OjIwQUVCMzo2RThENUQ6OTQyOTQ1OjZCMDYyREM0IiwidmlzaXRvcl9pZCI6IjQ0MDcxNzUyMTQxNTE2MjI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 82a7612cb4653d0187b4acbd7ebd28bd1b09ffb00ff1e2453f3f43826ea7c0b6 |
| hovercard-subject-tag | issue:5969723816 |
| 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/511/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d48f67160694cf6d49343e4c071151e6b48c45ce6ca140f9e859321d0f419d09/developing-today/code/issues/511 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d48f67160694cf6d49343e4c071151e6b48c45ce6ca140f9e859321d0f419d09/developing-today/code/issues/511 |
| og:image:alt | Summary Both lab-ops-hub crawl validators strip exactly one trailing dot before the blocked-host checks (#466), so a second trailing dot — or any empty label — defeats those checks, and the malform... |
| 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 | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| 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 | 494ea0bb1e0feef734a83e2628697647755e8864 |
| 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