T09 · Insecure Skill Coding Practices
- Location
tdd.py:8- Finding
Shell Command Injection Through the Test Path Argument
- Content
View full analysis
/tmp/tdd-pwned' --run 'python your_script.py' ``` 3. The program constructs the following effective shell command: ```bash pytest missing; id > /tmp/tdd-pwned ``` 4. `subprocess.run` passes the complete string to the system shell. 5. The shell runs pytest and then executes the injected `id` command. 6. If the injected command returns zero, the wrapper may treat the test stage as successful and proceed to the target command despite the failed or missing tests. ### Impact As ...[truncated 725 chars]- Remediation
View remediation
