CVE-2023-29374

In LangChain through 0.0.131, the LLMMathChain chain allows prompt injection attacks that can execute arbitrary code via the Python exec method

Critical · published April 5, 2023

CVSS v3.1
9.8
EPSS
40%
Percentile
98.6
In the wild
Unconfirmed
What it is

🚨 A sneaky prompt injection hides in LangChain, allowing attackers to unleash arbitrary code execution through a single evil prompt! 🔥 Think of the LLMMathChain as a chef in a restaurant who blindly follows any recipe handed to them—if a mischievous diner slips in a devious recipe, the chef might just whip up a disaster! 🍽️ An attacker could potentially take control of the server, executing any Python code they wish—this could mean accessing sensitive data, altering system functions, or worse! The fallout could be absolutely devastating, leaving your application vulnerable to all sorts of mayhem.

Put simply

Think of the LLMMathChain as a chef in a restaurant who blindly follows any recipe handed to them—if a mischievous diner slips in a devious recipe, the chef might just whip up a disaster! 🍽️ This vulnerability arises because the LLMMathChain improperly handles input, allowing attackers to inject malicious prompts that are executed through Python's exec method, leading to arbitrary code execution.

What to do

An attacker could potentially take control of the server, executing any Python code they wish—this could mean accessing sensitive data, altering system functions, or worse! The fallout could be absolutely devastating, leaving your application vulnerable to all sorts of mayhem. Immediate action is critical! Upgrade LangChain to version 0.0.132 or later to patch this vulnerability. Additionally, review your input handling to ensure that no untrusted data can be executed, and consider implementing strict input validation measures. You've got this! By following these steps, you'll protect your application and secure your code. 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.39653 · 98.6th percentile
Published
2023-04-05T00:00Z
EPSS history
Timeline
  • 05 APR 00:00Z
    In LangChain through 0.0.131, the LLMMathChain chain allows prompt injection attacks that can execute arbitrary code via the Python exec method
    cvelistv5