T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/ticktick.ts:29
- Finding
- OAuth Client Secret Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ticktick.ts:29-33` **Additional Location**: `SKILL.md:20-23`, `SKILL.md:33-36` **Vulnerability Type**: Sensitive credential exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```ts authCmd .option("--client-id <id>", "TickTick OAuth client ID") .option("--client-secret <secret>", "TickTick OAuth client secret") .option("--manual", "Manual auth flow for headless servers (paste redirect URL)") .option("--logout", "Clear authentication tokens") .option("--status", "Check authentication status") ``` The documented invocation explicitly places the secret on the command line: ```bash bun run scripts/ticktick.ts auth --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET ``` ### Technical Analysis The CLI accepts the OAuth client secret as a command-line option. Command-line arguments are not an appropriate secret-input channel because they may be retained in shell history, terminal session logs, automation logs, audit telemetry, or process-monitoring systems. Depending on operating-system controls, process arguments may also be observable by other local processes while authentication is running. This exposure is not required for the Skill's declared TickTick functionality. The secret can instead be collected through protected interactive input or a system credential manager. ### Attack Path 1. A user follows the documented authentication command and supplies the real client secret through `--client-secret`. 2. The shell records the complete command in its history or an automation platform records it in execution logs. 3. A local attacker, support process, backup collector, or user with access to those records retrieves the secret. 4. The attacker uses the exposed OAuth application credentials in attacks against the application's OAuth flow. The practical impact depends on TickTick's OAuth controls and whether the attacker can also obt ...[truncated 529 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--client-secret` as the recommended secret-input mechanism. 2. Prompt interactively using a hidden-input implementation that disables terminal echo. 3. Prefer storage and retrieval through the operating system's credential manager or keychain. 4. If environment-variable support is necessary for automation, document that CI systems must use masked secret variables and must not echo commands. 5. Keep the client ID as a normal option because it is not generally confidential, but handle the client secret separately. 6. Update `SKILL.md` so examples never place real secrets directly in shell commands. 7. Warn users to remove any previously entered commands from shell history and rotate secrets that may have entered shared logs. ]]>
