T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:99- Finding
Sensitive Medical Email Content Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/main.py, lines 99–100
Vulnerability Type: Sensitive data exposure through process arguments
Risk Level: MediumVulnerable Code
python draft = sys.argv[1] if len(sys.argv) > 1 else "hey, wanted to follow up on our discussion" recipient = sys.argv[2] if len(sys.argv) > 2 else "mentor"Technical Analysis
The script accepts the complete email draft through
sys.argv[1]. Because the skill supports patient correspondence, a draft may contain protected health information or other confidential medical data.Command-line arguments can be retained in shell history, captured by process-monitoring or audit systems, and—depending on operating-system permissions—observed through process-inspection facilities while the program is running. Consequently, sensitive content may be disclosed outside the intended program execution.
This handling is inconsistent with the skill's documented claim of “HIPAA-aware patient communication,” because the implementation provides no secure input channel, PHI detection, redaction, or warning against supplying sensitive information through command arguments.
Attack Path
-
A user runs the script with a confidential medical draft, for example:
bash python scripts/main.py "Patient Alice has been diagnosed with [condition]..." patient -
The shell may save the complete invocation in its command-history file.
-
While the process is running, a local user or monitoring component with sufficient access inspects the process command line.
-
Alternatively, an administrator, support tool, telemetry collector, or audit system records the invocation.
-
The observer obtains the medical content without needing to compromise the script itself.
Exploitation requires local access to relevant process metadata, history, or logs. The audit found no remote transmission mechanism.
Impact Assessment
The issue can disclose the full email draft, potentia ...[truncated 372 chars]
-
- Remediation
View remediation
Remediation Suggestions
-
Accept email drafts through standard input rather than command-line arguments:
python import sys draft = sys.stdin.read() if not draft.strip(): raise SystemExit("No email draft was provided through standard input.") -
Support permission-restricted input files only when necessary, validate the path, and document appropriate file permissions.
-
Retain only non-sensitive options, such as the recipient type, as command-line flags.
-
Explicitly warn users not to place protected health information or other confidential content in shell arguments.
-
Do not log raw drafts, command lines, or generated correspondence.
-
Review deployment telemetry, process monitoring, and shell-history controls to ensure they do not capture sensitive input.
-
Either implement and test concrete PHI-handling safeguards or narrow the “HIPAA-aware” documentation claim so it accurately reflects the implementation.
-
