Shihira / krunner-bridge

Write krunner 5 (plasma runner) plugins in python the quick way.
GNU General Public License v3.0
45 stars 4 forks source link

eval(query) completely unchecked for unsafe code #1

Open sigoa opened 6 years ago

sigoa commented 6 years ago

running res = eval(query)

on anything that example_calc.py
is getting is very dangerous. subprocess.

sth. like Popen(['/bin/bash', '-c', " rmdir . "])

some folks don't want to eval.

Shihira commented 6 years ago

Yes and that's why it is just an example. Functionality and safety are something contrary and require trade-off. But an example is good to be simple and brute I think. Those who really need safety would choose some safe eval substitution as shown in http://docs.pwntools.com/en/stable/util/safeeval.html , and others would be responsible to what they have typed.

PS. safe eval doesn't mean real safety. You can still construct a forever loop there and crash the krunner. So actually there is no such thing called absolute safety in the world.