Closed pixeebot[bot] closed 3 months ago
I'm confident in this change, but I'm not a maintainer of this project. Do you see any reason not to merge it?
If this change was not helpful, or you have suggestions for improvements, please let me know!
Just a friendly ping to remind you about this change. If there are concerns about it, we'd love to hear about them!
This change may not be a priority right now, so I'll close it. If there was something I could have done better, please let me know!
You can also customize me to make sure I'm working with you in the way you want.
This codemod sets the
shell
keyword argument toFalse
insubprocess
module function calls that have set it toTrue
.Setting
shell=True
will execute the provided command through the system shell which can lead to shell injection vulnerabilities. In the worst case this can give an attacker the ability to run arbitrary commands on your system. In most cases usingshell=False
is sufficient and leads to much safer code.The changes from this codemod look like this:
More reading
* [https://docs.python.org/3/library/subprocess.html#security-considerations](https://docs.python.org/3/library/subprocess.html#security-considerations) * [https://en.wikipedia.org/wiki/Code_injection#Shell_injection](https://en.wikipedia.org/wiki/Code_injection#Shell_injection) * [https://stackoverflow.com/a/3172488](https://stackoverflow.com/a/3172488)š§š¤ Powered by Pixeebot
Feedback | Community | Docs | Codemod ID: pixee:python/subprocess-shell-false