-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement S609, linux_commands_wildcard_injection
- Loading branch information
Showing
9 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import os | ||
import subprocess | ||
|
||
os.popen("chmod +w foo*") | ||
subprocess.Popen("/bin/chown root: *", shell=True) | ||
subprocess.Popen(["/usr/local/bin/rsync", "*", "some_where:"], shell=True) | ||
subprocess.Popen("/usr/local/bin/rsync * no_injection_here:") | ||
os.system("tar cf foo.tar bar/*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S609_S609.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_bandit/mod.rs | ||
--- | ||
S609.py:4:1: S609 Possible wildcard injection in call | ||
| | ||
4 | import subprocess | ||
5 | | ||
6 | os.popen("chmod +w foo*") | ||
| ^^^^^^^^ S609 | ||
7 | subprocess.Popen("/bin/chown root: *", shell=True) | ||
8 | subprocess.Popen(["/usr/local/bin/rsync", "*", "some_where:"], shell=True) | ||
| | ||
|
||
S609.py:5:1: S609 Possible wildcard injection in call | ||
| | ||
5 | os.popen("chmod +w foo*") | ||
6 | subprocess.Popen("/bin/chown root: *", shell=True) | ||
| ^^^^^^^^^^^^^^^^ S609 | ||
7 | subprocess.Popen(["/usr/local/bin/rsync", "*", "some_where:"], shell=True) | ||
8 | subprocess.Popen("/usr/local/bin/rsync * no_injection_here:") | ||
| | ||
|
||
S609.py:6:1: S609 Possible wildcard injection in call | ||
| | ||
6 | os.popen("chmod +w foo*") | ||
7 | subprocess.Popen("/bin/chown root: *", shell=True) | ||
8 | subprocess.Popen(["/usr/local/bin/rsync", "*", "some_where:"], shell=True) | ||
| ^^^^^^^^^^^^^^^^ S609 | ||
9 | subprocess.Popen("/usr/local/bin/rsync * no_injection_here:") | ||
10 | os.system("tar cf foo.tar bar/*") | ||
| | ||
|
||
S609.py:8:1: S609 Possible wildcard injection in call | ||
| | ||
8 | subprocess.Popen(["/usr/local/bin/rsync", "*", "some_where:"], shell=True) | ||
9 | subprocess.Popen("/usr/local/bin/rsync * no_injection_here:") | ||
10 | os.system("tar cf foo.tar bar/*") | ||
| ^^^^^^^^^ S609 | ||
| | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.