T09 · Insecure Skill Coding Practices
Warning
- Location
- ticktick/cli.py:67
- Finding
- OAuth Client Secret Exposed Through Command-Line Arguments## Vulnerability Details **File Location**: `ticktick/cli.py:29-31`, `ticktick/cli.py:67-68`, `SKILL.md:53-59` **Vulnerability Type**: Sensitive information exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```python if args.client_id and args.client_secret: setup_credentials(args.client_id, args.client_secret) ``` ```python auth_p.add_argument("--client-id", dest="client_id", metavar="<id>", help="TickTick OAuth client ID") auth_p.add_argument("--client-secret", dest="client_secret", metavar="<secret>", help="TickTick OAuth client secret") ``` The documented workflow explicitly instructs users to supply the secret in the command line: ```bash python -m ticktick.cli auth --client-id <YOUR_CLIENT_ID> --client-secret <YOUR_CLIENT_SECRET> python -m ticktick.cli auth --client-id <ID> --client-secret <SECRET> --manual ``` ### Technical Analysis Command-line arguments are not an appropriate transport for confidential values. Depending on the operating system and environment, arguments may be exposed through: - Shell history files. - Process-listing tools while the command is running. - Process accounting or endpoint telemetry. - Terminal session recording. - Automation logs, CI output, or command wrappers. - Agent execution traces that retain the complete command. The client secret is legitimately required for this OAuth client, but accepting it exclusively through an ordinary `argparse` option unnecessarily expands its exposure. The issue is particularly relevant for an Agent Skill because command invocations may be logged or retained outside the CLI itself. ### Attack Path 1. A user or Agent follows the authentication instructions in `SKILL.md`. 2. The OAuth client secret is included literally in the command's argument vector. 3. The command is retained in shell history, execution telemetry, process accounting, or an Agent log. ...[truncated 908 chars]
- Remediation
- ## Remediation Suggestions - Replace the ordinary `--client-secret` argument with an interactive hidden prompt using `getpass.getpass()`. - If noninteractive operation is required, accept the secret through a protected file descriptor, an operating-system keyring, or a narrowly scoped secret-manager integration. - Avoid environment variables as the default because they may also be exposed through process environments, crash reports, or automation logs. - If backward compatibility requires retaining `--client-secret`, mark it as deprecated and display a warning that it may expose the value through process metadata and command history. - Update `README.md` and `SKILL.md` so examples never place real secrets directly in command lines. - Advise existing users to remove commands containing secrets from shell history and rotate secrets if they may have been logged. - Ensure Agent integrations redact secret-bearing arguments from invocation logs and traces.
