Security: block SSRF DNS-rebinding and widen the IP deny-set (#279)

Add is_forbidden_ip() (loopback, RFC1918, link-local incl. 169.254.169.254,
broadcast, documentation, 0.0.0.0/::, IPv6 unique-local fc00::/7, IPv4-mapped
IPv6) and SsrfGuardResolver (impl reqwest::dns::Resolve) that resolves and
rejects forbidden addresses at connect time, closing the DNS-rebinding bypass.
Wired into the navigation client and the JS fetch()/XHR path. The
--allow-private-network / OBSCURA_ALLOW_PRIVATE_NETWORK escape hatch is kept.

Co-authored-by: charlesmamane26-sketch <[email protected]>
This commit is contained in:
charlesmamane26-sketchandcharlesmamane26-sketch authored and GitHub committed 2026-06-10 19:09:15 +00:00
1 parent 38fa85946c
commit 6ba3c63596
3 files changed
+187 -16

No files matched your search

+2 -2
View File
@@ -8,8 +8,8 @@ pub mod blocklist;
pub mod wreq_client;
pub use client::{
env_allows_private_network, ObscuraHttpClient, ObscuraNetError, RequestInfo, ResourceType,
Response,
env_allows_private_network, is_forbidden_ip, ObscuraHttpClient, ObscuraNetError, RequestInfo,
ResourceType, Response, SsrfGuardResolver,
};
pub use cookies::{CookieInfo, CookieJar};
pub use encoding::{