Skip to content

Commit

Permalink
Update docs/Secure-Coding-Guide-for-Python/CWE-707/CWE-78/README.md
Browse files Browse the repository at this point in the history
Co-authored-by: Georg Kunz <[email protected]>
Signed-off-by: myteron <[email protected]>
  • Loading branch information
myteron and gkunz authored Nov 6, 2024
1 parent e63e5bd commit 4e2f0ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ list_dir("temp")

```

In `noncompliant02.py` we have the attacker create a file toast.sh file that contains the commands to run. The attacker also creates a folder named `. -exec bash toast.sh {} +` that will later become part of the shell `find` command forming `find . -exec bash toast.sh {} +`.
In `noncompliant02.py` the attacker creates a `toast.sh` file that contains the commands to run. The attacker also creates a folder named `. -exec bash toast.sh {} +` that will later become part of the shell `find` command forming `find . -exec bash toast.sh {} +`.

The result is that `list_dir(dirname)` will run the `toast.sh` as a shell script. The `toast.sh` file does not require execute rights and can contain any quantity of shell command complexity.

Expand Down

0 comments on commit 4e2f0ca

Please sign in to comment.