-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Labels
BugIt must work in all situations, but this failedIt must work in all situations, but this failed
Milestone
Description
What happened?
In this function https://github.com/petl-developers/petl/blame/master/petl/util/base.py#L681 eval
is used so it's really risky and could lead to potential security issues. With this version any python code could be triggered so getting reverse shell is not a big deal.
POC:
expr("__import__('os').system('id')")(2)
iterfieldmap is affected https://github.com/petl-developers/petl/blob/master/petl/transform/maps.py#L106
What is the expected behavior?
Do not use eval? Remove the function from the codebase?
Reproducible test case
What version of petl are you have found the bug?
ANY
Version
python 3.9
What OS are you seeing the problem on?
Linux
What OS version are you using?
No response
What package manager you used to install?
pip
What's the current installed packages?
No response
Relevant log output
Additional Notes
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
msiedlarztgd
Metadata
Metadata
Assignees
Labels
BugIt must work in all situations, but this failedIt must work in all situations, but this failed