Arbitrary Command Execution The advisory has been revoked - it doesn't affect any version of package pandas  (opens in a new tab)


Threat Intelligence

Exploit Maturity
Proof of concept

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 Learn

Learn about Arbitrary Command Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-PANDAS-8549481
  • published25 Dec 2024
  • disclosed24 Dec 2024
  • creditAftersnows@360

Introduced: 24 Dec 2024

CVE-2024-9880  (opens in a new tab)
CWE-77  (opens in a new tab)

Amendment

This was deemed not a vulnerability.

Overview

pandas is a Python package providing data structures designed to make working with structured (tabular, multidimensional, potentially heterogeneous) and time series data both easy and intuitive.

Affected versions of this package are vulnerable to Arbitrary Command Execution in the pandas.DataFrame.query() function, which is commonly exposed by applications to accept user input. Code can be injected into a Python expression, which will be executed with the privileges of the application.

Note:

This behavior is not considered a vulnerability in this library because no guarantee of security is made by pandas. Notwithstanding this separation of concerns, this issue can be exploited when unsanitized input is allowed and developers should be aware of the potential consequences. Instances of exploitable public endpoints have been reported.

A warning has been added to the package's documentation to indicate that query() can evaluate arbitrary code, just like eval(). To prevent against this, developers are strongly encouraged to parameterize the queries that this method accepts as input, and to sanitize those input parameters to ensure they take the expected form.

The corresponding CVE, which is still only reserved, is expected to be rejected on the basis of the facts outlined above.

PoC

@pd.core.frame.com.builtins.__import__("os").system("""ping google.com #""")