feat: SSRF protection — block private IP ranges on outgoing requests
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user