LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages (langchain-ai langchain)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.43 % · percentile 37 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- GitHub_M
- NVD status
- Analyzed
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.
Weaknesses (CWE)
- CWE-918 — Server-Side Request Forgery
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | LOW 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L | GitHub_M |
| CVSS 3.1 | LOW 3.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L | NVD · security-advisories@github.com (Secondary) |
Advisories
- GHSA-2g6r-c272-w58r — LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages
- PYSEC-2026-2562 — LangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messages
European references
- ENISA EUVD · EUVD-2026-6240
- GCVE · GCVE-0-2026-26013
CERT-FR advisories
- CERTFR-2026-AVI-0424 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:langchain:langchain_core:*:*:*:*:*:python:*:*< 1.2.11
Affected products
| Product | Versions |
|---|---|
| langchain-ai · langchain | affected < 1.2.11 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |