Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Tirith final_expression parser from eval() to a safer approach #172

Open
refeed opened this issue Aug 28, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@refeed
Copy link
Member

refeed commented Aug 28, 2024

Currently, the Tirith's final_expression expression is parsed by using Python's eval() function. Though we already have the eval() usage made as safe as possible, we still need to replace it with a safer approach like using a library.

An inspiration is to use:
https://github.com/pyparsing/pyparsing/blob/master/examples/simpleBool.py

@refeed refeed added the enhancement New feature or request label Aug 28, 2024
@refeed
Copy link
Member Author

refeed commented Aug 28, 2024

Or at least, replace eval() with https://docs.python.org/3/library/ast.html#ast.literal_eval

for the first iteration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant