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

Input is not safe #13

Open
zwang20 opened this issue Mar 19, 2019 · 2 comments
Open

Input is not safe #13

zwang20 opened this issue Mar 19, 2019 · 2 comments
Labels
bug Something isn't working potentially fixed this issue might be potentially fixed

Comments

@zwang20
Copy link
Member

zwang20 commented Mar 19, 2019

Malicious code may be injected into the program through the function input

@zwang20 zwang20 added the bug Something isn't working label Mar 19, 2019
@Edward-Ji Edward-Ji added the potentially fixed this issue might be potentially fixed label Jun 2, 2021
@Edward-Ji
Copy link
Contributor

Partially fixed. Call to classes like Func(), Var() won't run. However, calls to built-in functions like print() still create unwanted results.

@Edward-Ji
Copy link
Contributor

Python's built-in eval() method is notorious for its lack of security. There are multiple ways to improve it. If we require better security and functionality, we tend to need fancier methods. For starters, we can make it somewhat safer by limiting the environment. We can pass maths variables and functions as arguments instead of evaluating them in a global scope. If we demand even better security, we may need to convert to a standard library parse, like the one in ast. Or even better, we should write a custom parser. The rabbit hole just gets deeper and deeper.

@Edward-Ji Edward-Ji removed their assignment Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working potentially fixed this issue might be potentially fixed
Projects
None yet
Development

No branches or pull requests

2 participants