T09 · Insecure Skill Coding Practices
- Location
scripts/processes.py:25- Finding
Unredacted Process Command Lines May Disclose Secrets
- Content
View full analysis
Vulnerability Details
File Location:
scripts/processes.py, lines 25-77
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: MediumTechnical Analysis
The process query collects complete command-line arguments, executable paths, and current working directories for every process visible to
osquery. These values are then written directly to standard output without filtering or redaction.python def processes(): query = "SELECT pid, name, parent, path, start_time, cmdline, cwd, user_time, system_time, percent_processor_time FROM processes ORDER BY pid;"python cmdline = process.get("cmdline", "")python print(f"{pid}|{name}|{parent}|{path}|{start_time}|{cmdline}|{cwd}|{user_time}|{system_time}|{percent_processor_time}")Command-line arguments commonly contain sensitive values, including API tokens, database connection strings, passwords, private repository URLs, session identifiers, and temporary credentials. Current working directories and executable paths can additionally reveal usernames, project names, customer names, and internal filesystem structure.
Although process inspection is related to the skill's declared activity-reporting functionality, collecting and returning complete command lines exceeds the minimum information required to identify running programs. There is no allowlist, explicit opt-in for sensitive fields, output sanitization, or warning before the data is exposed to the calling agent and any associated logs.
Attack Path
- A user or another agent starts a process with a secret in its arguments, such as
--token,--password, or a credential-bearing URL. - The skill invokes
scripts/processes.py. - The script runs the bundled
osqueryibinary and requests the process's completecmdlineandcwd. - The returned values are printed without redaction.
- The calling agent, conversation transcript, telemetry system, or ot ...[truncated 651 chars]
- A user or another agent starts a process with a secret in its arguments, such as
- Remediation
View remediation
Remediation Suggestions
- Remove
cmdlineandcwdfrom the default query and output. Return only minimally necessary fields such as PID and process name. - Require an explicit command-line option or separate user confirmation before collecting detailed process metadata.
- If command lines must be supported, redact values associated with sensitive argument names such as
password,passwd,token,secret,api-key,authorization, andcredential. - Redact credentials embedded in URLs and connection strings, including user-information components and sensitive query parameters.
- Consider returning an argument count or executable name instead of raw arguments.
- Display a clear warning that detailed process information may contain credentials and should not be persisted in conversation history or logs.
- Apply data-retention controls to downstream agent output and telemetry.
- Add tests covering common secret formats to ensure they never appear in default output.
- Remove
