Commit Graph
2 Commits
Author SHA1 Message Date
clawbot c3df5754f4 Test that a blocked_networks entry in the IPv4-mapped form is read as its IPv4 range
check / check (push) Canceled after 0s
Two new tests, failing until the fix. An entry such as
::ffff:10.0.0.0/104 must load as 10.0.0.0/8, since the fetcher matches
an IPv4-mapped address as the IPv4 address it holds. An entry in that
form shorter than /96 must abort startup naming blocked_networks and
the value.

Model: opus-5-5
2026-10-18 23:18:44 +00:00
clawbot 3cfcda0730 feat: blocked_networks config and extended SSRF ranges (closes #67)
check / check (push) Failing after 1s
Adds the blocked_networks config key: a list of CIDRs, parsed with net/netip, that is added to the built-in list of address ranges the fetcher refuses to contact and can never remove an entry from it. An invalid CIDR aborts startup naming the key and the value.

The built-in list gains CGNAT 100.64.0.0/10, IETF protocol assignments 192.0.0.0/24, benchmark 198.18.0.0/15 and NAT64 64:ff9b::/96. Resolved addresses are unmapped before matching, so IPv4-mapped IPv6 forms are caught too. Enforcement stays in the dial-time re-resolution, which is what closes the DNS rebinding window.

What a reader would trip over: 192.0.0.0/24 is now blocked but TEST-NET-1 (192.0.2.0/24), which the Fetch tests use as a public upstream, is a different range and stays dialable. The package-level dialer enforces the built-in ranges only; operator entries are applied by the fetcher.

Disclosure: one nolint:gochecknoglobals on the immutable built-in prefix list.

Model: opus-4-8 (implementation, review); fable-5-1 (landing message)
2026-09-22 00:43:27 +02:00