Skip to content

Remove shell=True#313

Merged
prgeor merged 1 commit intosonic-net:masterfrom
maipbui:pysec
Sep 28, 2022
Merged

Remove shell=True#313
prgeor merged 1 commit intosonic-net:masterfrom
maipbui:pysec

Conversation

@maipbui
Copy link
Contributor

@maipbui maipbui commented Sep 27, 2022

Signed-off-by: maipbui [email protected]

Description

subprocess() - use shell=False, use list of strings Ref: https://semgrep.dev/docs/cheat-sheets/python-command-injection/#mitigation

Motivation and Context

subprocess() - when using with shell=True is dangerous. Using subprocess function without a static string can lead to command injection.

How Has This Been Tested?

Pass UT tests/pcie_common_test.py

Additional Information (Optional)

Signed-off-by: maipbui <[email protected]>
@prgeor prgeor merged commit 31ca0ea into sonic-net:master Sep 28, 2022
@maipbui maipbui deleted the pysec branch September 28, 2022 16:57
yxieca pushed a commit that referenced this pull request Oct 3, 2022
Signed-off-by: maipbui <[email protected]>

Signed-off-by: maipbui <[email protected]>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants