pydantic-ai-slim is vulnerable to Exposure of Sensitive Information
42
Medium Risk
The safe_download helper in the SSRF-protected download path forwards caller-supplied request headers, including Authorization, Cookie, and Proxy-Authorization, when following HTTP redirects. It decides whether to drop these sensitive headers by comparing only the redirect target hostname against the original hostname. A redirect that keeps the same hostname but changes the scheme or port is treated as same-origin, so credentials are forwarded to a different origin such as a plaintext http downgrade or a different port on the same host. The fix compares the full origin of scheme, host, and port and strips the sensitive headers on any cross-origin redirect except an http-to-https upgrade on the same host.
You are affected if you are using a version that falls within the vulnerable range and your application forwards sensitive headers such as Authorization or Cookie when downloading a URL whose redirect target can be externally influenced.
pydantic-ai-slim is vulnerable to Exposure of Sensitive Information in versions 1.77.0 - 2.21.0.
Upgrade the pydantic-ai-slim and/or the pydantic-ai library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant