T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/send_bulk_sms.py:95
- Finding
- CloudSMS Authentication Key Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/send_bulk_sms.py:95-99` and `SKILL.md:86-90` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: High ### Vulnerable Code ```python channel = sys.argv[1] auth_key = sys.argv[2] mobile = sys.argv[3] content = sys.argv[4] signature = sys.argv[5] if len(sys.argv) > 5 else None ``` The documented invocation explicitly places the authentication key on the command line: ```bash python3 scripts/send_bulk_sms.py "<channel_id>" "<auth_key>" "<mobile>" "<content>" ["<signature>"] ``` ### Technical Analysis The CloudSMS authentication key is accepted as `sys.argv[2]`. Command-line arguments are not an appropriate secret-transport mechanism because they may be exposed through: - Process inspection utilities and operating-system process metadata. - Agent execution logs and tool-call traces. - Shell command history. - Job schedulers, monitoring platforms, and audit telemetry. - Error reports that capture complete command invocations. The Channel ID and authentication key together authorize requests to the external SMS service. Although the script does not print the key directly, passing it through the process command line expands its exposure beyond the intended script. ### Attack Path 1. A user supplies a valid CloudSMS Channel ID and authentication key to the Skill. 2. The agent invokes the script with both credentials embedded in the command line. 3. A local user, monitoring service, command logger, or other process with access to process metadata or execution logs records the invocation. 4. The observer extracts the Channel ID and authentication key. 5. The exposed credentials are used to submit independent requests to the CloudSMS API. 6. The attacker can send messages and consume resources within the permissions and balance of the compromised CloudSMS account. ### Impact Assessment This issue does not grant additional operating-system privileges by its ...[truncated 365 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not pass the authentication key through command-line arguments. - Retrieve the key from a dedicated secret manager where available. - As a fallback, read the key from a protected environment variable or standard input. Standard input should be used in a way that does not echo or log the value. - Pass only a secret reference or identifier through the command line, not the secret itself. - Ensure agent tool-call traces, subprocess logs, exception handlers, and telemetry redact the Channel ID and authentication key. - Restrict the secret's file or environment access to the executing account. - Rotate any authentication keys that may already have appeared in command histories or execution logs. - Update `SKILL.md` so its invocation example no longer instructs the agent to include the key in the command line. ]]>
