What’s Vulnerable › Vulnerabilities

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

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 products

How to fix

Upgrade to a fixed version: langchain-ai langchain 1.2.11. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2026-26013 or the next vulnerability affects your stack