webFetch SSRF checks in resolve_and_validate_url_target, is_blocked_ip, and is_blocked_hostname:
2130706433, 0x7f000001, 0177.0.0.1, 127.1, 0x7f.0.0.1) are blocked as 127.0.0.1 with no DNS lookup.example.com@evil.com, are rejected before DNS. Empty @ userinfo still validates the real host.::ffff:192.168.1.50, blocks the whole name. An empty lookup fails closed. Internal suffixes such as .localhost and .internal do not match lookalikes like localhost.example.crates/cowork-tools/src/web.rs (ssrf_gate_tests).The Rust port of web fetch had only a handful of direct loopback and metadata cases. These tests lock the classifier edges and the ordering of scheme, credential, literal, and DNS checks, so a parser or mask change cannot silently send a saved API-adjacent fetch at a private or rewritten loopback address.
No production behavior changes.
cargo test -p cowork-tools --lib ssrf_gate_tests: 7 passed.cargo clippy -p cowork-tools --lib --tests -- -D warnings: clean.rustfmt --edition 2024 --check crates/cowork-tools/src/web.rs: clean.Sign in to comment.
Update README.md
#125 mobile-fixes ← main
Updated 5 months ago