Superagent
superagent-ai/superagentContributor · Security · PDF URL validation
Merged Jan 13, 2026
Pull request #1098
What I've done
Implemented URL safety checks in both Python and TypeScript SDKs so PDF download flows validate untrusted links before any network request—blocking RFC1918 and loopback targets, localhost, disallowed schemes such as file://, and enforcing http(s) with a sensible length limit.
Reduced SSRF risk from user-supplied URLs by pairing hostname parsing with DNS resolution on the TypeScript side (using robust IPv4/IPv6 private-range checks, including IPv4-mapped IPv6), treating lookup failures conservatively so bypass tricks like friendly domains resolving to internal IPs are harder to exploit.
Kept behavior backward compatible for legitimate public URLs while surfacing clear validation errors for blocked or malformed inputs; iterated through maintainer review until the checks matched production expectations.
