Low, CVSS 3.1PyPIAmendedPublished
langchain-openai: Image token counting SSRF protection can be bypassed via DNS rebinding
CVE-2026-41488 · GHSA-r7w7-9xr2-qq2r
- Affected
- PyPI langchain-openai < 1.1.14
- Fixed in
- 1.1.14· Vendor fix available
- Issue
- langchain-openai's urltosize() helper (used by getnumtokensfrommessages for image token counting) validated URLs for SSRF protection and then fetched them in a separate network operation with independent DNS resolution. This left a TOCTOU / DNS rebinding window: an attacker-controlled hostname could resolve to a public IP during validation and then to a private/localhost IP during the actual fetch. The practical impact is limited because the fetched response body is passed directly to Pillow's Image.open() to extract dimensions — the response content is never returned, logged, or otherwise exposed to the caller. An attacker cannot exfiltrate data from internal services through this path. A potential risk is blind probing (inferring whether an internal host/port is open based on timing or error behavior). Affected versions - langchain-openai < 1.1.14 Patched versions - langchain-openai = 1.1.14 (requires langchain-core = 1.2.31) Affected code File:…
Recommended action: Upgrade to 1.1.14 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.