subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
size_mb *= 1024 if size_mb > cfg["journal_max_size_mb"]: if not dry_run: subprocess.run( ["journalctl", "--vacuum-size=f{cfg['journal_max_size_mb']}M"], timeout=30, capture_output=True )- Confidence
- 93% confidence
- Finding
- The journal vacuum command is malformed: the intended f-string is written as a literal string, producing an invalid argument like --vacuum-size=f{cfg['journal_max_size_mb']}M. In a privileged remediation agent, this silent failure can prevent log cleanup during disk pressure, increasing the chance of denial of service from disk exhaustion.
