feat: SSRF protection — block private IP ranges on outgoing requests
Some checks failed
CI / fmt (push) Successful in 23s
CI / test (push) Has been cancelled
CI / clippy (push) Has been cancelled

SsrfVerifier rejects private/reserved IPs (loopback, RFC1918, link-local,
CGNAT, ULA) on all federation fetches. Raw reqwest calls in webfinger and
backfill also validated. Debug mode bypasses via PermissiveVerifier.

Closes #4
This commit is contained in:
2026-05-30 02:48:35 +02:00
parent 7171a1791a
commit 4cb8efb6ce
5 changed files with 148 additions and 1 deletions

View File

@@ -48,7 +48,11 @@ impl ApFederationConfig {
.await?
} else {
let mut builder = FederationConfig::builder();
builder.domain(&data.domain).app_data(data).debug(false);
builder
.domain(&data.domain)
.url_verifier(Box::new(crate::security::SsrfVerifier))
.app_data(data)
.debug(false);
if let Some(actor) = signing_actor {
builder.signed_fetch_actor(actor);
}