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

- Severity: Low 3.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.42%, higher than 38% of CVEs (2026-12-01)
- Published: 2026-02-10T21:51:07.741Z
- Modified: 2026-09-10T03:50:33.793Z
- Also known as: GHSA-2g6r-c272-w58r, PYSEC-2026-2562
- Weaknesses: CWE-918
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- langchain-ai langchain: < 1.2.11
- langchain-core (PyPI): before 1.2.11
- langchain langchain_core: before 1.2.11

## Every score

- GitHub_M: CVSS:3.1 3.7 Low `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.1 3.7 Low `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L`
- PyPA Advisory Database: CVSS:3.1 3.7 Low `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> (mitigation, vendor-advisory, web)
- <https://github.com/langchain-ai/langchain/commit/2b4b1dc29a833d4053deba4c2b77a3848c834565> (patch, web)
- <https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.11> (product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-26013> (advisory)
- <https://github.com/langchain-ai/langchain> (package)
- <https://pypi.org/project/langchain-core> (package)
- <https://github.com/advisories/GHSA-2g6r-c272-w58r> (advisory)

## Sources

- CVE List: [CVE-2026-26013](https://www.cve.org/CVERecord?id=CVE-2026-26013), CVE Terms of Use, modified 2026-02-11
- GitHub Advisory Database: [GHSA-2g6r-c272-w58r](https://github.com/advisories/GHSA-2g6r-c272-w58r), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-26013](https://nvd.nist.gov/vuln/detail/CVE-2026-26013), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-2562](https://osv.dev/vulnerability/PYSEC-2026-2562), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-26013 · Whole record: https://cve.day/CVE-2026-26013.json · Rebuilt by cve.day 2026-11-25T22:59:13.758Z
