T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
API Keys May Be Exposed Through Agent Conversations and Command-Line Arguments
- Content
View full analysis
None: """Save API key — user pastes it interactively or via --key flag.""" api_key = args.key if not api_key: print() print(" DreamAPI Authentication") print(" ─────────────────────────────────────────") print(f" Get your API key from: {DASHBOARD_URL}") print(" Go to Dashboard → API Keys → Copy your key") print() api_key = input(" Paste your API key here: ").strip() ``` `scripts/auth.py:221-233`: ```python Examples: python auth.py login # interactive: paste your key python auth.py login --key "sk-abc..." # non-interactive python auth.py status # check if authenticated python auth.py logout # remove credentials """, ) sub = parser.add_subparsers(dest="subcommand") sub.required = True p_login = sub.add_parser("login", help="Save your API key") p_login.add_argument( "--key", default=None, help="API key (skip interactive prompt)", ) ``` ### Technical Analysis The Skill instructs users to provide an API key directly to the agent. Secrets supplied through a conversation can remain in chat history, agent execution transcripts, telemetry, or service logs. The documented `--key` mechanism creates another exposure channel because command-line arguments may be retained in shell history, captured by execution logs, or temporarily visible through process-inspection facilities. Although an interactive path exists, it uses `input()`, which visibly echoes the key. These exposure channels are unnecessary becau ...[truncated 1286 chars]- Remediation
View remediation
