Intel

AIKIDO-2026-716787

pydantic-ai-slim is vulnerable to Exposure of Sensitive Information

Exposure of Sensitive Information Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 2 days ago

42

Medium Risk

This Affects:

PYTHONpydantic-ai-slim
1.77.0 - 2.21.0
Fixed in 2.22.0
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

pydantic-ai-slim is vulnerable to Exposure of Sensitive Information in versions 1.77.0 - 2.21.0.

How to fix this

Upgrade the pydantic-ai-slim and/or the pydantic-ai library to the patch version.