T09 · Insecure Skill Coding Practices
- Location
scripts/sora2_generate.py:173- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
None: parser.add_argument("--api-key", help="NanoPhoto API key") parser.add_argument("--timeout", type=int, default=60, help="Per-request timeout in seconds (default: 60)") parser.add_argument("--user-agent", default=DEFAULT_USER_AGENT, help="HTTP User-Agent override") ``` ### Technical Analysis The script permits the NanoPhoto API key to be supplied through the `--api-key` command-line option. Command-line arguments are not an appropriate secret-delivery mechanism because they can be exposed through: - Shell command history. - Process inspection utilities and operating-system process interfaces. - Diagnostic, monitoring, or audit systems that record process command lines. - Wrapper scripts, CI logs, or terminal session recordings. The script subsequently uses this value as a bearer credential for requests to the fixed NanoPhoto HTTPS API endpoints. Network transmission of the key to NanoPhoto is necessary for the declared video-generation functionality, but accepting it through a command-line argument unnecessarily expands its local exposure. The script already supports safer credential sources: the `NANOPHOTO_API_KEY` environment variable and the skill-specific entry in `~/.openclaw/openclaw.json`. No transmission of unrelated credentials or configuration values was identified. ### Attack Path 1. A user runs the script with `--api-key`, for example: ```bash python3 scripts/sora2_generate.py submit --api-key SECRET_VALUE --prompt "Example" ``` 2. The complete command is retained in shell history, captured by process monitoring, or temporarily exposed through the operating system's process list. 3. Another local user, process, log reader, or monitoring ...[truncated 985 chars]- Remediation
View remediation
