-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
Subprocess input data warning on literal command #373
Comments
I was taking a look at this. I can't actually think of a safe way to reliably ascertain this at runtime. It is possible to check the argument using bandit, but I can't work out how to distinguish the situation where a string is formatted using a variable one line above and then supplied in. The original source code could maybe be loaded through introspection at runtime and checked but I'm not confident this approach is rock-solid.
|
+1 and it will be awesome if we can get some official take on this one please (i.e. |
Bandit reports this even when performing a self test:
|
@ericwb can you provide some guidance on how this issue should be resolved? This is blocking our rollout of bandit on a couple of projects. I have a developer who can work on the fix, but it would help if you can point them in the right direction. |
Duplicate of #333 |
Describe the bug
Bandit reports when user is trying to call subprocess, even when command is static.
To Reproduce
Create
test.py
:Call:
Expected behavior
Bandit shouldn't report B603 on line 4, because there is no way untrusted input appear there.
Bandit version
The text was updated successfully, but these errors were encountered: