SSRF Vulnerability in LangChain Framework by LangChain AI
CVE-2026-41488
What is CVE-2026-41488?
LangChain, a framework designed for building agent-based applications with large language models, contains a security vulnerability in the langchain-openai component prior to version 1.1.14. The _url_to_size() helper function, utilized for counting tokens in images, implements a flawed validation mechanism against Server-Side Request Forgery (SSRF). Specifically, it validates URLs to ensure SSRF protection but subsequently fetches them in a separate operation that allows for a Time-of-Check to Time-of-Use (TOCTOU) attack. An adversary can exploit this by controlling a hostname, compelling it to resolve to a public IP during the validation stage and subsequently redirecting it to a private or localhost IP address during the fetch process.
Affected Version(s)
langchain-openai < 1.1.14
