Skip to main content
VulnerabilityPublished Updated

CVE-2025-46059: langchain-ai · Code Injection

Affects langchain-aiSource CVE Database V5

0

Not known to be exploited · CVSS 9.8 Critical.

Data as of 26 Oct 2026, 10:12 UTC

CVSS 3.1 base score
9.8Critical
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.7% chance of exploitation in 30 days – higher than 55% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 29 Jul 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Affected software

ProductAffectedFixed in
PyPIlangchain-aipkg:pypi/langchain-aiOther threatsAffected
  • =0.3.51
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

To mitigate this vulnerability, European organizations should: 1) Immediately review and audit any user-written code integrating langchain-ai's GmailToolkit to ensure strict adherence to LangChain's security best practices, particularly input validation and sanitization to prevent prompt injection. 2) Implement strict email filtering and validation mechanisms to detect and block crafted malicious emails before they reach the application. 3) Employ runtime application self-protection (RASP) or behavior monitoring to detect anomalous code execution patterns within applications using langchain-ai. 4) Isolate systems running langchain-ai components from critical infrastructure to limit potential lateral movement in case of compromise. 5) Engage with the langchain-ai community and suppliers for updates or patches addressing this issue and apply them promptly once available. 6) Conduct penetration testing focused on prompt injection scenarios to identify and remediate weaknesses proactively. 7) Educate developers on secure coding practices specific to prompt-based AI integrations to prevent similar vulnerabilities in the future.

Description

langchain-ai v0.3.51 was discovered to contain an indirect prompt injection vulnerability in the GmailToolkit component. This vulnerability allows attackers to execute arbitrary code and compromise the application via a crafted email message. NOTE: this is disputed by the Supplier because the code-execution issue was introduced by user-written code that does not adhere to the LangChain security practices.

References

Community reviews

Loading reviews…