Redline #4 · RFC-1918 & Metadata Block · $0 HTTP 422

SSRF Protection & Cloud Metadata IP Blocking in API Gateways

Any gateway that accepts caller-supplied URLs—especially scraping and enrichment routers—is a prime target for Server-Side Request Forgery against cloud metadata services and internal hosts. FuelRouter enforces a hard pre-dispatch SSRF deny-list across schemes, hostnames, and IPv4/IPv6 CIDRs.

FuelRouter SSRF Deny-List Policy (Security Redline #4)

Validation DimensionBlocked Rules / ValuesPermitted ExceptionRejection Response
URL Schemesfile://, ftp://, gopher://, javascript:, data:http:// and https:// onlyHTTP 422 ssrf_blocked ($0)
IPv4 Private & Loopback127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Configured 127.0.0.1:18793 vault bridgeHTTP 422 ssrf_blocked ($0)
Cloud Metadata Link-Local169.254.0.0/16, 169.254.169.254, metadata.google.internalNone (unconditionally blocked)HTTP 422 ssrf_blocked ($0)
IPv6 Private & Loopback::1/128, fc00::/7, fe80::/10NoneHTTP 422 ssrf_blocked ($0)
Internal Hostnameslocalhost, 0.0.0.0, metadata, *.local, *.internal, *.localhostExplicit test-mode mock flag onlyHTTP 422 ssrf_blocked ($0)

Fail-Closed Pre-Dispatch URL Inspection

FuelRouter validates caller-provided URLs during input normalization—before cache lookup, before quota deduction, and before opening any outbound socket. Both literal IP addresses and blocked suffixes (.local, .internal, .localhost, .localdomain) are rejected instantaneously.

Because SSRF rejection returns HTTP 422 with charged_micros: 0, attackers cannot use malformed URL probes to drain a tenant's prepaid wallet or trip upstream circuit breakers.

Strict Sandbox Separation for Local Vault & Test Mode

The only loopback origin permitted in production is the explicitly configured Register-Anything Vault bridge (http://127.0.0.1:18793), which is never reachable through caller-supplied scraping URLs.

Local mock-upstream test servers require an explicit opt-in flag (allow_local_test_upstreams=True) restricted strictly to automated test suites.

Verify SSRF Guard Rejects Cloud Metadata Endpoint with $0 Charge

curl -i -X POST "https://fuelrouter.fastmesh.dev/v1/router/dispatch" \
  -H "Content-Type: application/json" \
  -d '{
    "pool_id": "clean_scrape_extract",
    "tenant_id": "security_audit",
    "inputs": {"url": "http://169.254.169.254/latest/meta-data/"}
  }'
# Expected: HTTP 422, {"ok": false, "error_code": "ssrf_blocked", "charged_micros": 0, "billed_usd": 0.0}

SSRF Hardening Verification Checklist

Frequently Asked Technical Questions

Can a caller reach the local 127.0.0.1:18793 vault proxy by submitting it as a scrape URL?

No. Caller-supplied URLs are evaluated strictly against the SSRF deny-list; 127.0.0.0/8 is blocked for all caller inputs.

Does an SSRF-blocked request affect upstream circuit breaker failure counters?

No. SSRF validation runs pre-dispatch and never touches upstream circuit state or quotas.

Are IPv6 link-local addresses blocked?

Yes. ::1/128, fc00::/7, and fe80::/10 are explicitly denied.

Live Try-Now Console & Machine Discovery

Test failover routing, dry-run quotes, and circuit breaker metrics on the live gateway or connect via JSON-RPC 2.0 MCP.

Related FuelRouter Architecture Guides