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

Consider whitelisting code execution linters if argument is constant string #8

Open
mschwager opened this issue Jan 10, 2020 · 0 comments

Comments

@mschwager
Copy link
Contributor

Many of Dlint's checks looking for code execution bugs due to user input aren't insecure if its argument is a constant string. E.g. eval("2+2"). There are a few linters where this is the case:

$ rg 'constant string'
docs/linters/DUO120.md
36:* Code may be safe if data passed to `marshal` is a constant string

docs/linters/DUO119.md
36:* Code may be safe if data passed to `shelve` is a constant string

docs/linters/DUO106.md
41:* Code may be safe if data passed to `os.system` is a constant string

docs/linters/DUO103.md
36:* Code may be safe if data passed to `pickle` is a constant string

docs/linters/DUO104.md
35:* Code may be safe if data passed to `eval` is a constant string

docs/linters/DUO105.md
42:* Code may be safe if data passed to `exec` is a constant string

docs/linters/DUO110.md
43:* Code may be safe if data passed to `compile` is a constant string and limits data size

We should consider adding logic to these linters to prevent false positives when the argument is a constant string.

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

No branches or pull requests

1 participant