T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
" --api-key ark_your_key` | | **Config File** | `echo '{"api_key":"ark_your_key"}' > ~/.qoder/apis/redfox.json` | ``` From `scripts/downloader.py:125-126`: ```python parser.add_argument("url", help="X(Twitter) video link, e.g. https://x.com/user/status/xxxxx") parser.add_argument("--api-key", help="API Key (format ark_xxx; falls back to env var or config file if not provided)") ``` From `scripts/downloader.py:137`: ```python api_key = get_api_key(cli_key=args.api_key) ``` ### Technical Analysis The skill explicitly supports and documents supplying `REDFOX_API_KEY` as a command-line argument. Secrets passed through command-line arguments can be exposed through shell history, process inspection utilities, process monitoring software, terminal session logs, or automation logs. While exposure through the process table depends on the operating system and its access controls, shell-history persistence is a common and durable disclosure channel. The code accepts the credential directly from `argparse`, so the secret is present in the process argument vector for the duration of execution. ### Attack Path 1. A user follows the documented example and invokes the downloader with `--api-key ark_secret`. 2. The shell records the full command, including the API key, in its command history. 3. During execution, the key may also be visible in the process argument list to an authorized same-host user or monitoring process. 4. A local attacker, support operator, or process with ac ...[truncated 632 chars]- Remediation
View remediation
