fix(review): block the RFC 6598 CGNAT range in both safe-url twin guards - #7265
Conversation
ipv4IsPrivateOrLocal rejected five private/reserved IPv4 ranges but not 100.64.0.0/10 (RFC 6598 shared address space / carrier-grade NAT) -- a non-publicly-routable range cloud providers assign to internal service endpoints, exactly what this SSRF guard exists to block. A URL resolving to a 100.64.x.x-100.127.x.x host passed the IPv4 check as if it were public. Add the range check to BOTH copies of the guard -- the engine copy (packages/loopover-engine/src/review/safe-url.ts) and its live host twin (src/review/content-lane/safe-url.ts), a NAMED_TWIN_PAIR kept in lock-step by check-engine-parity.ts -- so the SSRF protection stays consistent across every call site. Boundary-tested in both files' suites. Closes JSONbored#7253
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7265 +/- ##
=======================================
Coverage 93.81% 93.81%
=======================================
Files 704 704
Lines 69448 69452 +4
Branches 18897 18899 +2
=======================================
+ Hits 65152 65156 +4
Misses 3302 3302
Partials 994 994
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-19 11:28:12 UTC
Review summary Nits — 3 non-blocking
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
What
ipv4IsPrivateOrLocal— the SSRF-safe URL guard's IPv4 check — rejected five private/reserved ranges but not100.64.0.0/10(RFC 6598 "Shared Address Space" / carrier-grade NAT), which cloud/hosting providers assign to internal service endpoints. A URL resolving to a100.64.x.x–100.127.x.xhost passed the check as if it were public.How
Add one additive check —
if (a === 100 && b >= 64 && b <= 127) return true;— following the identical inline style as the five existing checks, to both copies of the guard:packages/loopover-engine/src/review/safe-url.ts(engine copy)src/review/content-lane/safe-url.ts(the live host twin — imported byqueue/processors.ts,orb/relay.ts,orb/federated-collector.ts, and the visual-capture path)These two files are a
NAMED_TWIN_PAIRenforced byscripts/check-engine-parity.ts, so patching only one would both leave a live SSRF gap and fail the parity drift-check.engine-parity:drift-checkpasses with both patched identically.Validation
Boundary regression tests added to both test suites (
safe-url-engine.test.tsandcontent-lane-safe-url.test.ts):100.64.0.0/100.127.255.255(inclusive bounds — blocked),100.100.50.1(mid-range — blocked), and100.63.255.255/100.128.0.0(just outside — public/safe). Confirmed both suites fail against the unfixed guards and pass with the fix;engine-parity:drift-checkandtypecheckpass.Closes #7253