Skip to content

Instantly share code, notes, and snippets.

View kenseehart's full-sized avatar

Ken Seehart kenseehart

View GitHub Profile
@kenseehart
kenseehart / safe_eval.py
Last active June 26, 2023 21:19
yase - Yet Another Safe Eval
'''
Okay, so the python community consensus is that eval is inherently unsafe (with untrusted input), and it is impossible to
construct a safe wrapper on eval that can't be hacked.
Just because it's impossible, doesn't mean it can't be done.
Please hack this, and comment. If you can hack this, I promise to keep my mouth shut during security related
conversations for not less than six months.
Possible solution when: