Skip to content

Commit b5b2d38

Browse files
authored
DOC: Document Remote Code Execution risk for Dataframe.query and computation.eval (pandas-dev#58697)
1 parent 7868a58 commit b5b2d38

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pandas/core/computation/eval.py

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def eval(
193193
corresponding bitwise operators. :class:`~pandas.Series` and
194194
:class:`~pandas.DataFrame` objects are supported and behave as they would
195195
with plain ol' Python evaluation.
196+
`eval` can run arbitrary code which can make you vulnerable to code
197+
injection if you pass user input to this function.
196198
197199
Parameters
198200
----------

pandas/core/frame.py

+3
Original file line numberDiff line numberDiff line change
@@ -4472,6 +4472,9 @@ def query(self, expr: str, *, inplace: bool = False, **kwargs) -> DataFrame | No
44724472
"""
44734473
Query the columns of a DataFrame with a boolean expression.
44744474
4475+
This method can run arbitrary code which can make you vulnerable to code
4476+
injection if you pass user input to this function.
4477+
44754478
Parameters
44764479
----------
44774480
expr : str

0 commit comments

Comments
 (0)