T09 · Insecure Skill Coding Practices
- Location
scripts/generate_auth_token.py:27- Finding
Reusable API Credentials Exposed Through Command-Line Arguments and Standard Output
- Content
View full analysis
") sys.exit(1) app_key = sys.argv[1] app_secret = sys.argv[2] token = generate_access_token(app_key, app_secret) print(f"Access Token: {token}") print(f"\nUse in Authorization header as: Basic {token}") ``` The insecure invocation is also explicitly recommended in `SKILL.md:19`: ```bash python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET ``` ### Technical Analysis The script accepts the application secret as a command-line argument and prints a Base64 representation of `app_key:app_secret` to standard output. Base64 is an encoding mechanism, not encryption. Any party that obtains the generated token can decode it to recover both credential values or replay it directly as an HTTP Basic Authorization credential. Printing the token therefore has substantially the same security implications as printing the original secret. Passing the secret through `sys.argv` can expose it through shell history, process inspection facilities, diagnostic tooling, terminal recording, and execution logs. Printing the generated token creates additional exposure through Agent transcripts, captured standard output, CI logs, shell scrollback, and other logging systems. The client-side Base64 construction in `scripts/tomoviee_recognition_client.py:17-25` is not independently classified as a vulnerability because it constructs a standard Basic-auth header in memory and sends it over HTTPS to the fixed, documented Wondershare API. The avoidable security issue is the separate helper's disclosu ...[truncated 1645 chars]- Remediation
View remediation
