Skip to main content

langchain-openai EUVDEUVD-2026-25635

| CVE-2026-41488 LOW
Server-Side Request Forgery (SSRF) (CWE-918)
2026-04-24 GitHub_M
3.1
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit image URL with attacker-controlled domain
  2. Delivery
    DNS resolves to public IP, passes SSRF validation
  3. Exploit
    Attacker flips DNS record to internal/private IP
  4. Execution
    Application issues independent fetch DNS resolution
  5. Persist
    httpx connects to internal host
  6. Impact
    Timing or error response reveals open port

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Credential Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application accept attacker-controlled image URLs and route them through langchain-openai's get_num_tokens_from_messages function (or any call path that invokes _url_to_size()). The UI:R CVSS metric reflects that the application must actively process the submitted URL - typical in API endpoints that accept multimodal OpenAI-format chat payloads with image_url content blocks from untrusted users. Beyond application-level access, successful DNS rebinding requires attacker-operated DNS infrastructure with sub-second TTL control and favorable timing to win the race between the validation DNS query and the fetch DNS query; this is attacker-controllable but non-trivial to execute reliably. What limits exploitation: (1) the response body is consumed internally by Pillow and never surfaced, making this a blind probe rather than an exfiltration vector; (2) AC:H conditions mean automated, at-scale exploitation is not viable per SSVC automatable=no; (3) the attacker must know or guess internal host/port combinations to probe, providing no directory-style enumeration.

Impact

All available signals converge on a low-priority risk profile. The CVSS 3.1 base score of 3.1 (Low) is driven by AC:H - DNS rebinding demands attacker-controlled DNS infrastructure with sub-TTL timing precision - and C:L with I:N/A:N, reflecting that only blind inference is possible. EPSS at 0.03% (8th percentile) confirms the exploitation probability is negligible in the near term. SSVC rates exploitation as none, automatable as no, and technical impact as partial, meaning this does not meet the threshold for emergency remediation under standard prioritization frameworks. The vendor advisory explicitly caps the worst-case outcome at blind port probing based on timing or error behavior differences, since Pillow consumes the response internally without surfacing it. No conflicting signals are present: CVSS, EPSS, SSVC, and the absence from CISA KEV are mutually consistent. The primary mitigating factor is the response-body containment within Pillow - this is what prevents the classic SSRF data-exfiltration scenario and limits the vulnerability to a reconnaissance primitive against internal infrastructure.

Exploit ScenarioDerived

An attacker registers a domain and configures its DNS with a TTL of 0-1 seconds, initially pointing to a legitimate public IP so that validate_safe_url() permits the request. The attacker immediately flips the DNS record to an internal address such as 192.168.1.1 or the cloud metadata endpoint 169.254.169.254 before the application's resolver issues the second lookup for the httpx.get() call, causing the fetch to reach an internal host. By observing whether the call returns quickly, times out, or raises a connection-refused error, the attacker can determine whether a given internal host and port are reachable - a blind port-scanning primitive against the application's internal network segment. No public proof-of-concept code is known at time of analysis.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

DNS rebinding in langchain-openai before 1.1.14 allows an attacker-controlled hostname to bypass SSRF protection in the image token-counting code path, enabling blind probing of internal network services. The _url_to_size() helper performs URL validation and the subsequent HTTP fetch as two independent operations with separate DNS resolution, creating a TOCTOU race window that a malicious domain with a short TTL can exploit to redirect the fetch to a private or localhost address after passing the initial check. Practical impact is bounded: the HTTP response is consumed only by Pillow for image dimension extraction and is never returned or logged, making data exfiltration impossible; SSVC confirms no active exploitation, EPSS sits at the 8th percentile, and no public exploit code exists at time of analysis.

RemediationAI

Upgrade langchain-openai to version 1.1.14 or later and simultaneously upgrade langchain-core to 1.2.31 or later, as the fix depends on SSRFSafeSyncTransport introduced in that langchain-core release. The full advisory with patch details is at https://github.com/langchain-ai/langchain/security/advisories/GHSA-r7w7-9xr2-qq2r. If immediate patching is not possible, apply egress firewall rules on the application server to block outbound HTTP/HTTPS to RFC-1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), the APIPA/link-local range (169.254.0.0/16 including the AWS/GCP metadata endpoint 169.254.169.254), and the IPv6 loopback/ULA ranges; note that this control operates at the network layer and does not fix the TOCTOU race itself, so a sufficiently creative attacker with DNS infrastructure in a routable but sensitive IP space could still probe those ranges. As a secondary control, avoid exposing get_num_tokens_from_messages to untrusted user-provided image URLs without sanitizing the URL to a known-good allowlist before it reaches langchain-openai.

Affected VersionsENISA

langchain-openai < 1.1.14

Affected Packages

pypi langchain-openai fix: 1.1.14

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability is in libs/partners/openai/langchain_openai/chat_models/base.py within _url_to_size(), which is invoked by get_num_tokens_from_messages to measure image dimensions for token budget calculations. The root cause is CWE-918 (Server-Side Request Forgery) in its TOCTOU form: the function first calls validate_safe_url() to block private-range destinations, but then issues a completely independent httpx.get() call whose DNS resolution is separate from the validation step. An attacker who controls a domain sets a near-zero TTL and initially answers with a public IP to pass validation; before the second resolution occurs, the attacker flips the DNS record to a private RFC-1918 address, the cloud metadata endpoint 169.254.169.254, or a Kubernetes cluster-internal address. The affected CPE is cpe:2.3:a:langchain-ai:langchain-openai:*:*:*:*:*:*:*:* for all versions prior to 1.1.14. The fix (langchain-openai 1.1.14) replaces the validate-then-fetch pattern with SSRFSafeSyncTransport from langchain-core, which resolves DNS once, validates all returned IPs against a comprehensive policy, pins the TCP connection to that IP, and disables redirect following.

Know when Langchain Openai gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 3.1 LOW
AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
vuln.today AI 3.1 LOW

DNS rebinding demands attacker DNS infrastructure and precise timing (AC:H); response body is Pillow-internal only, so I:N and A:N; blind probing warrants C:L.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Lifecycle Timeline

3
Patch released
Apr 28, 2026 - 18:17 nvd
Patch available
Patch available
Apr 24, 2026 - 23:02 EUVD
CVE Published
Apr 24, 2026 - 20:57 nvd
LOW 3.1

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 4 pypi packages depend on langchain-openai (4 direct, 0 indirect)

Ecosystem-wide dependent count for version 1.1.14.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Prevalence
Medium
popular Python SDK for OpenAI-backed LLM applications
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

16
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +16
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy