T09 · Insecure Skill Coding Practices
- Location
scripts/collect_articles.py:83- Finding
OS Command Injection Through the User-Controlled URL
- Content
View full analysis
' | browser-harness ``` A URL containing a single quote can terminate the `printf` argument. Shell metacharacters can then append an arbitrary operating-system command. Quoting the URL inside the generated Browser Harness script does not protect the surrounding shell command. This is distinct from the safer `_run_browser_script()` implementation in `scripts/utils.py`, which invokes Browser Harness using an argument array and passes the script through standard input without a shell. ### Attack Path 1. An attacker supplies a crafted value for `--url`, or convinces a user or automation workflow to execute the collector with that value. 2. `args.url` is assigned to `profile["list_url"]`. 3. The value is interpolated into `navigate_code`. 4. The generated code is placed inside a single-quoted `printf` shell command. 5. A single quote in the attacker-controlled value terminates the quoted shell argument. 6. The attacker's appended shell command is interpreted because `shell=True` is enabled. 7. The command executes with the operating-system privileges of the user running th ...[truncated 670 chars]- Remediation
View remediation
