T09 · Insecure Skill Coding Practices
- Location
scripts/veo_3_1.py:226- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/veo_3_1.py, lines 226 and 264
Vulnerability Type: Sensitive credential exposure through process arguments and shell history
Risk Level: MediumThe script permits users to provide the NanoPhoto API key through the
--api-keycommand-line argument and gives that value precedence during credential resolution.python def add_common_auth_args(parser: argparse.ArgumentParser) -> 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")python def main() -> None: parser = build_parser() args = parser.parse_args() api_key = resolve_api_key(getattr(args, "api_key", None)) if not api_key: fail("Missing API key. Pass --api-key, set NANOPHOTO_API_KEY, or configure ~/.openclaw/openclaw.json skills.entries.veo-3-1.env.NANOPHOTO_API_KEY.")Technical Analysis
Command-line arguments are not an appropriate transport for long-lived secrets. A command such as:
bash python3 scripts/veo_3_1.py submit --api-key SECRET_VALUE ...may expose the credential through shell-history files, process listings, process-monitoring software, diagnostic reports, terminal logging, or automation logs. Depending on the operating system and its process-inspection controls, other local users or monitoring agents may be able to inspect the argument while the process is running.
This behavior is unnecessary because the script already supports the more appropriate
NANOPHOTO_API_KEYenvironment variable and a narrowly scoped OpenClaw configuration entry. The affected credential is subsequently used as the bearer token for requests to the fixed NanoPhoto HTTPS endpoints.Attack Path
- A user follows the suppo ...[truncated 1394 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
--api-keycommand-line option and its precedence inresolve_api_key. - Prefer secret injection through the declared
NANOPHOTO_API_KEYenvironment variable or the platform's protected Skill configuration. - If interactive credential entry is required, use Python's
getpass.getpass()so the key is not echoed or placed in process arguments. - Update
SKILL.md, command help, and error messages so they no longer recommend or advertise command-line credential submission. - Ensure the OpenClaw configuration file containing the fallback credential has restrictive filesystem permissions and is readable only by the owning account.
- Advise users who previously used
--api-keyto remove affected shell-history and automation-log entries and rotate potentially exposed keys.
- Remove the
