You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, Table.eval() uses python's eval function, which is considered unsecure because it can execute arbitrary python code. This issue is to discuss how we could secure it. My suggestion is that we should limit eval to use only recognized functions and variables from the Table, and maybe also some explicit provided variables by the user.
One suggestion is to compile the string into ast (https://docs.python.org/3/library/ast.html), and then use that to either verify that the code doesn't do anything we consider unsafe. This is a python standard library feature that is extremely flexible (meaning we could extend it as needed). It's also what was used for dspeed (although this feature shouldn't have to be that complicated). We could even consider modifying the code (e.g., we could replace all and any with ak.all and ak.any for ease of use).
The text was updated successfully, but these errors were encountered:
Right now,
Table.eval()
uses python'seval
function, which is considered unsecure because it can execute arbitrary python code. This issue is to discuss how we could secure it. My suggestion is that we should limiteval
to use only recognized functions and variables from the Table, and maybe also some explicit provided variables by the user.One suggestion is to compile the string into
ast
(https://docs.python.org/3/library/ast.html), and then use that to either verify that the code doesn't do anything we consider unsafe. This is a python standard library feature that is extremely flexible (meaning we could extend it as needed). It's also what was used for dspeed (although this feature shouldn't have to be that complicated). We could even consider modifying the code (e.g., we could replaceall
andany
withak.all
andak.any
for ease of use).The text was updated successfully, but these errors were encountered: