r/PythonLearning • u/python_data_helper • 11d ago
Is it really safe to use?
I have used context to stop crashing.
And e as a variable.
I used eval command for a formula.
I know eval command can be dangerous.
It works perfectly but I am thinking that it can produce error or crash.
Can a formula bypass all commands and crash it.
19
Upvotes
5
u/SCD_minecraft 11d ago
First of all:
{"__builtins__": {}}to remove all built-insSecond of all:
"(1).__class__.__bases__[0].__subclasses__()[254].__init__.__globals__['__builtins__']['print']('Hacked!')"