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

Add subprocess-list-passed-as-string for Python #3579

Merged
merged 5 commits into from
Mar 25, 2025

Conversation

Sjord
Copy link
Contributor

@Sjord Sjord commented Mar 12, 2025

subprocess.run and similar takes either a string or a sequence. Some calling code has a sequence, but converts it to string themselves. This is both unnecessary and insecure, as it removes the distinction between arguments. I.e. if arguments contain spaces or quotes this gives the wrong result.

Sjord and others added 5 commits March 12, 2025 11:06
subprocess.run and similar takes either a string or a sequence. Some calling code has a sequence, but converts it to string themselves. This is both unnecessary and insecure, as it removes the distinction between arguments. I.e. if arguments contain spaces or quotes this gives the wrong result.
…thon/lang/security/audit/subprocess-list-passed-as-string.py
…python/lang/security/audit/subprocess-list-passed-as-string.yaml
@inkz inkz enabled auto-merge (squash) March 25, 2025 20:13
@inkz inkz merged commit 8a871e7 into semgrep:develop Mar 25, 2025
8 checks passed
inkz added a commit that referenced this pull request Mar 26, 2025
* Improve `insecure-load-balancer-tls-version` AWS rule (#3584)

Add support for `ELBSecurityPolicy-TLS13-1-2-Res-2021-06`, which is the
most secure TLS 1.2+ policy that AWS ALBs offer. Recommend it as the preferred
fix for rule failures.

`ELBSecurityPolicy-TLS13-1-2-Res-2021-06` removes the following (insecure)
cipher suites as compared to `ELBSecurityPolicy-TLS13-1-2-2021-06` because
they are CBC-based instead of GCM-based:

- ECDHE-ECDSA-AES128-SHA256
- ECDHE-RSA-AES128-SHA256
- ECDHE-ECDSA-AES256-SHA384
- ECDHE-RSA-AES256-SHA384

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/describe-ssl-policies.html#tls-security-policies

Also, improve/clean-up related test.

Co-authored-by: Vasilii Ermilov <[email protected]>

* Add subprocess-list-passed-as-string for Python (#3579)

* Add subprocess-list-passed-as-string for Python

subprocess.run and similar takes either a string or a sequence. Some calling code has a sequence, but converts it to string themselves. This is both unnecessary and insecure, as it removes the distinction between arguments. I.e. if arguments contain spaces or quotes this gives the wrong result.

* Update subprocess-list-passed-as-string.yaml

* Rename python/lang/security/subprocess-list-passed-as-string.py to python/lang/security/audit/subprocess-list-passed-as-string.py

* Rename python/lang/security/subprocess-list-passed-as-string.yaml to python/lang/security/audit/subprocess-list-passed-as-string.yaml

---------

Co-authored-by: Vasilii Ermilov <[email protected]>
Co-authored-by: Vasilii Ermilov <[email protected]>

* bump Ubuntu version in Github actions (#3593)

* bump Ubuntu version in Github actions

* bump setup-python version

* bump python versions in Github actions

* bump python versions in Github actions

---------

Co-authored-by: Reed Loden <[email protected]>
Co-authored-by: Vasilii Ermilov <[email protected]>
Co-authored-by: Sjoerd Langkemper <[email protected]>
Co-authored-by: Vasilii Ermilov <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants