Cyber Resilience

CVE-2025-46059

RCE

Published
29 July 2025
Modified
17 June 2026
CVSS Score v3.1 9.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0070 50th percentile
Risk Priority 72 floored blend · peak EPSS

Summary

CVE-2025-46059 is a critical-severity Code Injection (CWE-94) vulnerability in Langchain (inferred from references). Its CVSS base score is 9.8 (Critical).

Operationally, exploitation aligns with the MITRE ATT&CK technique Command and Scripting Interpreter (T1059); ranked at the 50th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

This vulnerability is AI-related — categorised as NLP and Transformers; in the LLM/Generative AI Risks risk domain.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2025-46059 is an indirect prompt injection vulnerability affecting langchain-ai version 0.3.51, specifically within the GmailToolkit component. This flaw enables attackers to execute arbitrary code and compromise the application through a crafted email message. The issue has been disputed by the supplier, who attributes the code-execution risk to user-written code that fails to adhere to LangChain security practices.

The vulnerability carries a CVSS v3.1 base score of 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H), indicating it is exploitable over a network with low complexity, no privileges or user interaction required. Remote attackers who can send a malicious email to a Gmail account monitored by the affected GmailToolkit can trigger the injection, potentially achieving high-impact confidentiality, integrity, and availability violations through arbitrary code execution.

Advisories and references, including LangChain's security documentation at python.langchain.com/docs/security/ and GitHub issues such as langchain-ai/langchain-community/issues/217#issuecomment-3144824471 and langchain-ai/langchain/issues/30833, highlight the dispute and emphasize adherence to established security practices. Additional details are available in the CVE write-up at github.com/Jr61-star/CVEs/blob/main/CVE-2025-46059.md, with no specific patches detailed in the provided information.

LangChain, used in AI and machine learning applications for building LLM chains, underscores the relevance of this vulnerability to secure prompt handling in AI workflows, though no real-world exploitation has been reported.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

the code-execution issue was introduced by user-written code that does not adhere to the LangChain security practices.

CWE(s)

AI Security AnalysisAI

AI Category
NLP and Transformers
Risk Domain
LLM/Generative AI Risks
OWASP Top 10 for LLMs 2025
LLM01:2025 Prompt Injection
AI-specific weaknesses CR
  • CWE-1427 — Indirect prompt injection reaches LLM then drives code exec sink.
Mapped by Cyber Resilience · not in NVD. Poisoning and extraction cases are routed to MITRE ATLAS instead of a synthetic CWE.
Classification Reason
Matched keywords: ai, langchain, prompt injection

Related Threats

MITRE ATT&CK Enterprise Techniques

T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.002 AppleScript Execution
Adversaries may abuse AppleScript for execution.
T1059.004 Unix Shell Execution
Adversaries may abuse Unix shell commands and scripts for execution.
T1059.005 Visual Basic Execution
Adversaries may abuse Visual Basic (VB) for execution.
T1059.006 Python Execution
Adversaries may abuse Python commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-31236Shared CWE-94
CVE-2026-46432Shared CWE-94
CVE-2026-22807Shared CWE-94
CVE-2025-33204Shared CWE-94
CVE-2025-66448Shared CWE-94
CVE-2025-14927Shared CWE-94
CVE-2025-14928Shared CWE-94
CVE-2025-14926Shared CWE-94
CVE-2026-68770Shared CWE-94
CVE-2026-40967Shared CWE-94

Affected Assets

Langchain
inferred from references and description; NVD did not file a CPE for this CVE

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V1.3.1

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation finds code paths that accept and execute externally influenced strings.

Input validation directly stops untrusted data from being used to construct executable code without neutralization.

Least privilege limits the damage an injected code fragment can perform once executed.

Requiring documented secure development standards and tools enforces use of safe code-generation APIs and escaping.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

PR.PS-06's SDLC practices directly target injection flaws via secure coding and testing (mostly), yet as a single broad outcome it leaves many code-generation specifics unaddressed (partial).

PR.DS-10 none match
prevents

PR.DS-10 protects runtime data confidentiality/integrity but has no bearing on neutralizing externally influenced input during code generation, so neither direction shows any preventive effect.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

Banning unapproved code samples and unauthenticated web services, combined with secure-coding standards and SAST, prevents the dynamic generation or inclusion of attacker-supplied code.

none

Controls that restrict unauthorized or malicious code from being introduced via external networks or removable media limit opportunities for an attacker to inject and execute arbitrary code.

References