CVE-2026-41488 Details
Description
LangChain is a framework for building agents and LLM-powered applications. Prior to 1.1.14, langchain-openai's _url_to_size() helper (used by get_num_tokens_from_messages 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.
A vulnerability in the langchain-openai library, prior to version 1.1.14, allows for Server-Side Request Forgery (SSRF) attacks via a DNS rebinding technique. The issue arises in the '_url_to_size()' helper function, which is used by 'get_num_tokens_from_messages' for counting image tokens. The function initially validates URLs for SSRF protection and then retrieves them in a separate network operation, leading to a time-of-check-to-time-of-use (TOCTOU) vulnerability. An attacker could exploit this by having a controlled hostname resolve to a public IP during validation and then to a private or localhost IP when the fetch occurs. Although the vulnerability's practical impact is limited—since the response is directly passed to Pillow's 'Image.open()' without exposure to the caller—it could still allow blind probing of internal services.
Users can upgrade to langchain-openai version 1.1.14 or later to address this vulnerability. The updated version requires langchain-core version 1.2.31 or later.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 27, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/langchain-ai/langchain/security/advisories/GHSA-r7w7-9xr2-qq2r | [email protected] | MitigationVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-918 | Server-Side Request Forgery (SSRF) | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| langchain langchain-openai | < 1.1.14 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 28, 2026 | Initial Analysis | [email protected] |
| Apr 24, 2026 | New CVE Received | [email protected] |