T09 · Insecure Skill Coding Practices
- Location
scripts/syshealth.py:161- Finding
Process Command-Line Arguments Are Exposed in Plaintext Health Reports
- Content
View full analysis
= 11: processes.append({ "user": parts[0], "pid": parts[1], "cpu": parts[2], "mem": parts[3], "command": parts[10][:60], }) except (subprocess.SubprocessError, FileNotFoundError): pass return processes ``` The collected process arguments are subsequently displayed and may be saved: ```python procs = get_top_processes(5) if procs: log(f"\n📋 Top Processes (by memory)") log(f" {'PID':<8} {'CPU%':<7} {'MEM%':<7} {'Command'}") log(f" {'─' * 8} {'─' * 7} {'─' * 7} {'─' * 40}") for p in procs: log(f" {p['pid']:<8} {p['cpu']:<7} {p['mem']:<7} {p['command']}") log(f"\n{'═' * 60}") if output: with open(output, "w") as f: f.write("\n".join(lines)) print(f"\n📝 Report saved to {output}") ``` ### Technical Analysis The `ps aux` command returns complete process command lines, including arguments. Applications and administrative scripts sometimes place credentials, API tokens, database connection strings, private URLs, session identifiers, or sensitive filesystem paths in those arguments. The implementation copies up to 60 characters of each command line into the report w ...[truncated 2487 chars]- Remediation
View remediation
