Tainted flow: 'env_file' from os.environ.get (line 709, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
f"export KUNPENG_SERVER_PORT=\"{port}\"\n" f"export KUNPENG_SERVER_USER=\"{user}\"\n" ) with open(env_file, 'w', encoding='utf-8') as f: f.write(content) try: os.chmod(env_file, 0o600)- Confidence
- 90% confidence
- Finding
- The output path is derived from TEMP/TMP environment variables and then opened for writing without validation. In an agent context, a hostile or manipulated environment could redirect the file write to an unintended location, causing credential/config file overwrite or placement in an attacker-observable path.
