Title: lab-ops-hub crawl validators disagree on IPv4 ranges — Python allows multicast, TS over-blocks public /24 neighbours as /16s · Issue #476 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub crawl validators disagree on IPv4 ranges — Python allows multicast, TS over-blocks public /24 neighbours as /16s · Issue #476 · developing-today/code
X Title: lab-ops-hub crawl validators disagree on IPv4 ranges — Python allows multicast, TS over-blocks public /24 neighbours as /16s · Issue #476 · developing-today/code
Description: Contribute to developing-today/code development by creating an account on GitHub.
Open Graph Description: Contribute to developing-today/code development by creating an account on GitHub.
X Description: Contribute to developing-today/code development by creating an account on GitHub.
Opengraph URL: https://github.com/developing-today/code
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub crawl validators disagree on IPv4 ranges — Python allows multicast, TS over-blocks public /24 neighbours as /16s","articleBody":"## Problem\n\nThe two lab-ops-hub crawl validators claim the same policy (`pkgs/lab-ops-hub/src/lib.ts`: \"The Python container crawler applies the same policy independently\"; `pkgs/lab-ops-hub/container/app.py`: \"Only public http(s) targets\"), but they disagree on IPv4 literals. Verified this run on main `668dd32f` by calling both validators on the same 2,542 candidate URLs (special-range + boundary samples): **169 divergent verdicts, all `TS blocks / Python allows`**.\n\n### 1. Python container validator ALLOWS IPv4 multicast — TS blocks it\n\nPython's plain-IPv4 path is just `elif not ip.is_global: raise`, and `ipaddress` reports `is_global == True` for multicast (verified: `224.0.0.1` → `is_global True, is_multicast True`):\n\n| URL | Python (`container/app.py` `validate_crawl_url`) | TS (`src/lib.ts` `validateCrawlUrl`) |\n|---|---|---|\n| `http://224.0.0.1/` … `http://239.255.0.1/` (224.0.0.0/4) | ALLOW | BLOCK (`a >= 224` in `ipv4IsGlobal`) |\n\nThe container is the component that actually fetches. The same flaw reaches the embedded-IPv4 path: `_embedded_ipv4` verdicts are judged with `embedded.is_global`, so e.g. an IPv4-mapped/NAT64 literal embedding a multicast address is also allowed. This is the IPv4 analogue of #474 (which fixed the IPv6 case by requiring global unicast 2000::/3 on the Python side — no equivalent guard exists for IPv4).\n\n### 2. TS Worker validator over-blocks four public ranges as /16s instead of /24s\n\n`ipv4IsGlobal` in `src/lib.ts:26-41` keys the narrow special ranges on the **second** octet (`b`), so a /24 whose distinguishing octet is the third is widened to a /16 — contradicting its own comments:\n\n| Code | Comment says | Actually blocks | Public addresses wrongly refused (Python: ALLOW) |\n|---|---|---|---|\n| `a===192 && b===0` | 192.0.0.0/24 + TEST-NET-1 192.0.2.0/24 | 192.0.0.0/16 | `192.0.1.1`; also the global 192.0.0.9/192.0.0.10 exceptions inside the /24 |\n| `a===192 && b===88` | 6to4 relay anycast (192.88.99.0/24) | 192.88.0.0/16 | `192.88.0.1`, `192.88.1.1` |\n| `a===198 && b===51` | TEST-NET-2 (198.51.100.0/24) | 198.51.0.0/16 | `198.51.0.1`, `198.51.1.1` |\n| `a===203 && b===0` | TEST-NET-3 (203.0.113.0/24) | 203.0.0.0/16 | `203.0.0.1`, `203.0.1.1` |\n\nNote the reverse gap inside the 6to4 row: Python **allows** `192.88.99.1` (`is_global True`), so the deprecated relay-anycast /24 the TS comment intends to refuse is only refused on the Worker path.\n\nBecause TS `ipv4IsGlobal` is reused for embedded IPv4 (IPv4-mapped, NAT64, 6to4 in `ipv6IsGlobal`), the over-blocks propagate to those IPv6 spellings too.\n\n## Why it matters\n\nThe validators are defence-in-depth for one SSRF policy (#441, #460–#474). The fetching component accepting the whole multicast range defeats the policy; the Worker refusing ordinary public addresses in four /16s is a correctness bug that also makes the two implementations impossible to keep in sync with shared test vectors.\n\n## Acceptance criteria\n\n- Both validators refuse the multicast range, e.g. `224.0.0.1`, `230.1.2.3`, `239.255.255.255`, including embedded spellings judged by a multicast IPv4 (e.g. `[::ffff:224.0.0.1]`).\n- Both validators refuse the narrow non-global /24s: `192.0.0.1` (except the global `192.0.0.9`/`192.0.0.10`, which both accept), `192.0.2.1`, `192.88.99.1`, `198.51.100.1`, `203.0.113.1`.\n- Both validators accept the public neighbours the TS side currently over-blocks: `192.0.1.1`, `192.88.0.1`, `198.51.0.1`, `203.0.0.1`, plus ordinary public targets (`8.8.8.8`).\n- The same test vectors appear in both suites (`test/lib.test.ts` and `test/test_container_validate.py`) with identical verdicts, in the style of the #472/#474 shared-vectors tests.\n- Suggested fix: in Python, do not trust `is_global` alone for IPv4 — also refuse `is_multicast` and `192.88.99.0/24` (plain and embedded paths). In TS, add the third octet `c` to `ipv4IsGlobal` and narrow the four checks above to their commented /24s (with the 192.0.0.9/.10 exceptions).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-21T12:13:02Z","url":"https://github.com/developing-today/code/issues/476"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:489f1967-9de2-da46-a77b-1e8060512a63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E55A:5CA6C:A6EC30:DFE339:6B0641B0 |
| html-safe-nonce | f3ab97d238d3d125bb8ad9573b3700287524f2f3975f96bc50c88750f9ddc372 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTVBOjVDQTZDOkE2RUMzMDpERkUzMzk6NkIwNjQxQjAiLCJ2aXNpdG9yX2lkIjoiODIyNDgyODc2MDIwMTc5Mzc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cc6c60fd8b8865eaf9bf4cf0f0c31ecaa856f9ab2b693caacbf11ace3dc07860 |
| hovercard-subject-tag | repository:627308783 |
| 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/developing-today/code/issues/476 |
| twitter:image | https://opengraph.githubassets.com/c1a2d415bd2c796fea2e23b2fed64a1efc7802730482e5b3777242c3e81bd5e2/developing-today/code |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1a2d415bd2c796fea2e23b2fed64a1efc7802730482e5b3777242c3e81bd5e2/developing-today/code |
| og:image:alt | Contribute to developing-today/code development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-cache |
| 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 | ac613d3698d3d8565651455086e1f74da07bf277 |
| 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