# CVE-2026-26013: LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages

> CVE-2026-26013: LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages. CVSS 3.7 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2026-26013
Last updated: 2026-06-17T10:25:35Z

- Published: 2026-02-10 21:51 UTC · Updated: 2026-06-17 10:25 UTC · Assigner: GitHub\_M
- CVSS: 3.7 (CVSS 3.1) · Severity: Low · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
- EPSS: 0.43%, 37th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-918

## 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 vendors and products

- langchain-ai: langchain

## Tracked companies

- [LangChain (LangSmith)](https://rewindex.com/company/langchain-langsmith.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2026-26013)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2026-26013)
- [https://github.com/langchain-ai/langchain/commit/2b4b1dc29a833d4053deba4c2b77a3848c834565](https://github.com/langchain-ai/langchain/commit/2b4b1dc29a833d4053deba4c2b77a3848c834565)
- [https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.11](https://github.com/langchain-ai/langchain/releases/tag/langchain-core%253D%253D1.2.11)
- [https://github.com/langchain-ai/langchain/security/advisories/GHSA-2g6r-c272-w58r](https://github.com/langchain-ai/langchain/security/advisories/GHSA-2g6r-c272-w58r)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2026-26013 · Markdown: https://rewindex.com/cve/CVE-2026-26013.md · JSON: https://rewindex.com/api/v1/cves/CVE-2026-26013 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T03:11:16.638Z
