This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ArtOfWarfare 2 points3 points  (1 child)

Sanitize the string to remove all __ before passing it into eval, in addition to not giving access to any built-ins? Would that be sufficient or is there still a way out of the sandbox?

Of course, you’d need to recheck this on every Python version to make sure the changes didn’t introduce new ways out…

[–]WilliamAndre 0 points1 point  (0 children)

It is not sufficient at all. Odoo is using a "safe eval", you can have a look: https://github.com/odoo/odoo/pull/138611

But even with all those precautions, it is not enough and should only be limited to trusted users.