Vulnerability · Published Feb 10, 2026 · Assigned by GitHub_M
CVE-2026-26013LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages
Low 3.7
In plain English
A low-severity server-side request forgery in langchain from langchain-ai. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 37% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
LangChain is a framework for building agents and LLM-powered applications. Prior to 1.2.11, the ChatOpenAI.get_num_tokens_from_messages() method fetches arbitrary image_url values without validation when computing token counts for vision-enabled models. This allows attackers to trigger Server-Side Request Forgery (SSRF) attacks by providing malicious image URLs in user input. This vulnerability is fixed in 1.2.11.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | langchain-core | 1.2.11 | GHSA-2g6r-c272-w58r |
| PyPI | langchain-core | 1.2.11 | PYSEC-2026-2562 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| langchain-ai | langchain | < 1.2.11 |
Weakness: CWE-918 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
References
- https://github.com/langchain-ai/langchain/security/advisories/GHSA-2g6r-c272-w58r x_refsource_CONFIRM
- https://github.com/langchain-ai/langchain/commit/2b4b1dc29a833d4053deba4c2b77a3848c834565 x_refsource_MISC
- https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.11 x_refsource_MISC