Skip to main content

Improper Neutralization of Special Elements Used in a Template Engine

CVE-2025-65106

Severity High
Score 8.3/10

Summary

LangChain is a framework for building agents and LLM-powered applications. Affected versions are through 0.3.79, 0.4.0.dev0, and 1.0.0 through 1.0.6. A template injection vulnerability exists in LangChain's prompt template system that allows attackers to access Python object internals through template syntax. This vulnerability affects applications that accept untrusted template strings (not just template variables) in ChatPromptTemplate and related prompt template classes. This issue has been patched in versions 0.3.80 and 1.0.7.

  • LOW
  • NETWORK
  • NONE
  • NONE

CWE-1336 - Improper Neutralization of Special Elements Used in a Template Engine

The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.

Advisory Timeline

  • Published