Skip to content

Commit c282017

Browse files
committed
feat: add SSRF protection for df.http()
Add compile-time dataplane protection that blocks HTTP requests to private/reserved IP ranges from the background worker. This prevents malicious users from using df.http() to probe internal network services, cloud metadata endpoints, or localhost services. Implementation: - New src/ssrf.rs module with IP blocklist (RFC 1918, loopback, link-local, ULA) and custom DNS resolver (SsrfSafeResolver) - Scheme validation: only http:// and https:// allowed - IPv4-mapped IPv6 handling (::ffff:A.B.C.D) - DNS rebinding protection via inline IP check before connect - Cargo feature 'ssrf-protection' (default=on), no runtime bypass - Audit logging: submitted_by and login_role on all HTTP requests - New spec: docs/spec-ssrf-protection.md Addresses threat T8 in spec-security-model.md.
1 parent 9fde5f7 commit c282017

7 files changed

Lines changed: 766 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ name = "pgrx_embed_pg_durable"
1414
path = "./src/bin/pgrx_embed.rs"
1515

1616
[features]
17-
default = ["pg17"]
17+
default = ["pg17", "ssrf-protection"]
18+
ssrf-protection = []
1819
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
1920
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
2021
pg15 = ["pgrx/pg15", "pgrx-tests/pg15" ]

0 commit comments

Comments
 (0)