T09 · Insecure Skill Coding Practices
- Location
scripts/detail_page_client.py:525- Finding
API Credential Exposure Through Command-Line Arguments
- Content
View full analysis
argparse.ArgumentParser: parser = argparse.ArgumentParser(description="Queenshow detail page OpenAPI client") parser.add_argument("--base-url", required=True, help="Example: https://host/api/promotion") parser.add_argument("--api-key", required=True) parser.add_argument("--summary", action="store_true", help="Print a compact verification-friendly summary") parser.add_argument("--show-sensitive", action="store_true", help="Do not redact sensitive fields in output") ``` The documented invocation directly encourages passing the secret on the command line: ```bash python .codex/skills/queenshow-detail-page/scripts/detail_page_client.py \ --base-url https://your-host/api/promotion \ --api-key qs_live_xxx \ --summary \ run \ --title "Running Shoes Detail Page" \ --main-image https://example.com/shoe-1.png \ --intro "Lightweight running shoes with breathable mesh and rebound foam." \ --detail-style "clean, premium, high contrast product photography" ``` ### Technical Analysis The client requires the Queenshow API key through the `--api-key` command-line option. Secrets supplied as process arguments may be exposed through: - Shell command history. - Process inspection tools available to other local users. - CI/CD and automation logs. - Terminal session recording. - Debugging and process-monitoring systems. - Wrapper scripts that log the complete command. The response-redaction mechanism does not mitigate this issue because it only processes API response data before printing it. It does not remove the API key from the original command line, process metadata, or shell history. ### Attack Path 1. A user follows the documented e ...[truncated 1184 chars]- Remediation
View remediation
