T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/promo_scheduler.py:137
- Finding
- Webhook Credential Exposure Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/promo_scheduler.py:137` and `SKILL.md:40-43,48-52` **Vulnerability Type**: Secret exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```python p_post.add_argument("--webhook-url", required=True, help="Discord webhook URL (never printed)") ``` The documented invocation also instructs users to provide the secret directly on the command line: ```bash python3 {baseDir}/scripts/promo_scheduler.py post \ --webhook-url <URL> \ --channel openclaw-discord \ --message "Hello from OpenClaw!" ``` ```bash python3 {baseDir}/scripts/promo_scheduler.py rotate \ --webhook-url <URL> \ --channel openclaw-discord \ --messages-file messages.txt ``` ### Technical Analysis A Discord webhook URL contains authentication material and should be treated as a credential. Although the application redacts the value from its own status messages, accepting it as a command-line argument exposes it outside the application's logging controls. Depending on the operating environment, command-line arguments may be retained or exposed through: - Interactive shell history. - Process listings and process-inspection interfaces. - CI/CD job metadata and command logs. - Scheduler definitions and service configuration. - Endpoint monitoring and process telemetry. - Debugging or diagnostic data. Consequently, the claim that the URL is “never printed” does not provide end-to-end protection for the credential. Application-level output redaction cannot prevent exposure by the shell or operating system. ### Attack Path 1. A user follows the documented example and supplies the Discord webhook URL through `--webhook-url`. 2. The shell records the command in its history, or the operating system exposes the argument through process inspection. 3. A local user, monitoring service, CI operator, or attacker with access to those records obtains the webhook URL. 4. The attacker sends reque ...[truncated 664 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Prefer a protected environment variable, such as `DISCORD_WEBHOOK_URL`, rather than a command-line option. - Support reading the credential from a permission-restricted file or standard input. - For interactive execution, use `getpass.getpass()` or another non-echoing input mechanism. - If `--webhook-url` is retained for compatibility, mark it as insecure and deprecated. - Update all usage examples so they do not place a real webhook URL in shell history. - Document appropriate secret rotation procedures and recommend immediate rotation after suspected exposure. - In CI/CD environments, use the platform's secret store and ensure command tracing is disabled while secrets are loaded. ]]>
