CVE-2025-46059

Unknown · Unknown Multiple Products

A critical vulnerability has been identified in the langchain-ai GmailToolkit component, which could be present in multiple products.

Executive summary

A critical vulnerability has been identified in the langchain-ai GmailToolkit component, which could be present in multiple products. This flaw, an indirect prompt injection, allows an attacker to gain control over the application by sending a specially crafted email, leading to arbitrary code execution and a potential full system compromise. The high severity of this vulnerability necessitates immediate action to prevent data theft, unauthorized access, and further network intrusion.

Vulnerability

The vulnerability is an indirect prompt injection within the GmailToolkit component of langchain-ai. An attacker can exploit this by sending a malicious email to an account being monitored by a LangChain agent. When the agent processes the email using the GmailToolkit, hidden instructions within the email's content are interpreted and executed by the underlying Language Model (LLM). This can trick the LLM into using other connected tools to perform unauthorized actions, such as executing arbitrary commands on the server running the agent, exfiltrating sensitive data, or manipulating other integrated systems.

Business impact

This vulnerability is rated as critical severity with a CVSS score of 9.8. Successful exploitation could have a devastating business impact. An attacker could gain complete control of the system hosting the LangChain application, leading to the theft of sensitive corporate data (including all accessible emails), deployment of ransomware, or using the compromised system as a pivot point to attack the wider internal network. The potential consequences include significant financial loss, severe reputational damage, regulatory fines, and a complete loss of confidentiality and integrity of the affected systems.

Remediation

Immediate Action: The primary remediation is to identify all applications using the vulnerable langchain-ai component and update them to the latest, patched version as recommended by the vendor. After patching, it is crucial to monitor for any signs of post-compromise activity and thoroughly review system and application access logs for any anomalous behavior preceding the update.

Proactive Monitoring: Implement enhanced monitoring on systems running LangChain applications. Look for unusual or unexpected processes spawned by the application, suspicious outbound network connections, and anomalous API calls to integrated tools (especially shell/command execution tools). In application logs, monitor for prompts that contain unexpected commands or instructions, particularly those originating from the GmailToolkit.

Compensating Controls: If immediate patching is not feasible, implement the following controls:

  • Run the LangChain application in a sandboxed and isolated environment with minimal privileges.
  • Apply strict network egress filtering to block all outbound connections except those explicitly required for operation.
  • If the GmailToolkit is not essential for business functions, disable it within the LangChain agent's configuration.
  • Implement an input validation and sanitization layer to inspect and neutralize potentially malicious instructions from external data sources like emails before they are processed by the LLM.

Exploitation status

Public Exploit Available: false

Analyst recommendation

Given the critical CVSS score of 9.8 and the risk of complete system compromise, this vulnerability requires immediate attention. Organizations must prioritize identifying and patching all affected systems without delay. While it is not yet listed in the CISA KEV, its severity indicates a high likelihood of future exploitation. If patching cannot be performed immediately, the compensating controls listed above, particularly disabling the vulnerable component and enforcing strict sandboxing, should be implemented as a matter of urgency to mitigate the significant risk.