Tainted flow: 'unit_content' from os.environ.get (line 425, credential/environment) → pathlib.Path.write_text (file write)
Medium
- Category
- Data Flow
- Content
WantedBy=multi-user.target """ unit_path = Path("/tmp/pvm.service") unit_path.write_text(unit_content) print(f"✅ Systemd unit written to {unit_path}") print(" To install (requires sudo):") print(f" sudo mv {unit_path} /etc/systemd/system/pvm.service")- Confidence
- 77% confidence
- Finding
- The generated systemd unit embeds User={os.environ.get('USER', 'root')} into a privileged service definition file. If an attacker can influence the environment when the wizard runs, they can cause the generated installation instructions and service file to reference an unintended account, potentially changing execution context or causing misconfiguration that persists after sudo installation.
