Tainted flow: 'queue_file' from os.environ.get (line 39, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
search_url = f'https://weixin.sogou.com/weixin?type=2&query={encoded_kw}' cmd = f'curl -s {shlex.quote(search_url)} -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"' with open(queue_file, 'w') as f: f.write(cmd) print(f"Command queued, waiting for router (up to 90s)...", file=sys.stderr)- Confidence
- 88% confidence
- Finding
- The script writes a shell command into a filesystem path taken from environment variables, creating a command-queue interface that can influence another privileged component. Even with absolute-path and '..' checks, an attacker who can control the environment or target files could redirect writes into sensitive control files or abuse this mechanism to trigger unintended network actions.
