Blocked Address Classes & Schemes (src/ssrf_guard.py)
Autonomous agents frequently scrape user-supplied URLs that can hide prompt-injected SSRF probes targeting localhost daemons or cloud metadata endpoints. DataFuel runs validate_public_url(url) before touching Register-Anything, ArchiveCache, or billing.
| Blocked Target Category | Example Inputs Rejected | HTTP Status | Upstream Egress | Billed Amount |
|---|---|---|---|---|
| Cloud instance metadata | http://169.254.169.254/latest/meta-data/ | 422 | Blocked (0 calls) | 0u ($0.00) |
| Loopback IPv4 / IPv6 | http://127.0.0.1:18793, http://[::1]:9050 | 422 | Blocked (0 calls) | 0u ($0.00) |
| RFC1918 private networks | http://10.0.0.1, http://172.16.0.5, http://192.168.1.1 | 422 | Blocked (0 calls) | 0u ($0.00) |
| Carrier-grade NAT & reserved | http://100.64.0.1, http://0.0.0.0 | 422 | Blocked (0 calls) | 0u ($0.00) |
| Non-HTTP(S) URI schemes | file:///etc/passwd, gopher://..., ftp://... | 422 | Blocked (0 calls) | 0u ($0.00) |
Why Unbilled 422 Protects Both Security and Prepaid Budgets
Billing on validation failures turns accidental or adversarial SSRF inputs into a denial-of-wallet attack. DataFuel raises SSRFBlockedError prior to ledger debit, returning structured redacted error JSON with billed_micros: 0.
Frequently Asked Questions
- Can DataFuel be tricked into probing the local Register-Anything daemon on port 18793?
- No. Loopback addresses including 127.0.0.1, localhost, and ::1 are unconditionally rejected by validate_public_url with HTTP 422 before egress.
- Are blocked SSRF probes written to ArchiveCache?
- Never. Blocked URLs fail pre-egress and leave zero cache entries and zero ledger debits.