CVE-2026-40087: fallo de gravedad media en langchain-ai langchain
LangChain has incomplete f-string validation in prompt templates
Publicada el · Actualizada el
13Vexday Risk Score
Sin señal de explotación. Ningún artefacto público de explotación conocido hasta ahora.
ssvc Trackcvss 5.3epss 0.5%
probabilidad de explotación
0.5%top 63% de las CVE
explotación observada
noninguna fuente lo reporta
LangChain is a framework for building agents and LLM-powered applications. Prior to 0.3.84 and 1.2.28, LangChain's f-string prompt-template validation was incomplete in two respects. First, some prompt template classes accepted f-string templates and formatted them without enforcing the same attribute-access validation as PromptTemplate. In particular, DictPromptTemplate and ImagePromptTemplate could accept templates containing attribute access or indexing expressions and subsequently evaluate those expressions during formatting. Second, f-string validation based on parsed top-level field names did not reject nested replacement fields inside format specifiers. In this pattern, the nested replacement field appears in the format specifier rather than in the top-level field name. As a result, earlier validation based on parsed field names did not reject the template even though Python formatting would still attempt to resolve the nested expression at runtime. This vulnerability is fixed in 0.3.84 and 1.2.28.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Productos afectados
langchain-ai · langchainCVEs relacionadas — langchain-ai langchain
En el mismo producto, de las más peligrosas a las menos.
CVE-2025-68664CRITICALLangChain serialization injection vulnerability enables secret extraction in dumps/loads APIsEPSS 42.9%CVE-2026-34070HIGHLangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functionsEPSS 1.2%CVE-2025-65106HIGHLangChain Vulnerable to Template Injection via Attribute Access in Prompt TemplatesEPSS 0.5%CVE-2026-26013LOWLangChain affected by SSRF via image_url token counting in ChatOpenAI.get_num_tokens_from_messagesEPSS 0.4%CVE-2026-44843HIGHLangChain: Unsafe deserialization of attacker-controlled LangChain objects through overly broad `load()` allowlistsEPSS 0.4%CVE-2026-55443MEDIUMLangChain: Path traversal and sandbox escape in LangChain file-search middleware and loadersEPSS 0.2%
Referencias
https://github.com/langchain-ai/langchain/commit/6bab0ba3c12328008ddca3e0d54ff5a6151cd27bhttps://github.com/langchain-ai/langchain/commit/af2ed47c6f008cdd551f3c0d87db3774c8dfe258https://github.com/langchain-ai/langchain/pull/36612https://github.com/langchain-ai/langchain/pull/36613https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D0.3.84https://github.com/langchain-ai/langchain/releases/tag/langchain-core%3D%3D1.2.28https://github.com/langchain-ai/langchain/security/advisories/GHSA-926x-3r5x-gfhw