T09 · Insecure Skill Coding Practices
- Location
query_vehicle.py:667- Finding
API Key Exposure Through Command-Line Arguments and Agent Conversation Logs
- Content
View full analysis
Vulnerability Details
File Location:
query_vehicle.py:667-670, 715-719;README.md:88, 98, 128, 185;SKILL.md:57, 60, 112
Vulnerability Type: Credential exposure through insecure secret input mechanisms
Risk Level: MediumThe project explicitly supports and documents passing a complete API key as a command-line argument:
bash python3 query_vehicle.py --apikey 'your_full_api_key' python3 query_vehicle.py --apikey 'your_full_api_key' --save-token-onlyThe corresponding implementation is:
python parser.add_argument( "--apikey", help="Provide the full API key and save it to cache / 提供完整 API Key 并写入缓存", )python def resolve_credentials(apikey: Optional[str], lang: str): if apikey: vehicle_token, access_token = parse_combined_token(apikey, lang) save_cache(vehicle_token, access_token, lang) return access_token, vehicle_tokenThe README also provides an installation prompt that encourages users to disclose the API key directly to an AI agent for configuration.
Technical Analysis
Secrets supplied in command-line arguments can be exposed through shell history, process listings, command telemetry, audit records, terminal logs, and automation logs. Any local account or monitoring process with permission to inspect process arguments may capture the complete API key while the command is running.
Supplying the key in an AI-agent conversation creates an additional disclosure channel. The credential may be retained in conversation history, execution traces, observability systems, or external model-provider logs. This behavior conflicts with the README's own warning that API keys should not be shared in chats.
The API key is split into a vehicle token and an access token. The access token is then sent as a bearer credential, while the vehicle token is sent in the request body. Exposure of the combined key therefore discloses the authent ...[truncated 1897 chars]
- Remediation
View remediation
Remediation Suggestions
- Deprecate and remove
--apikeyas a secret-bearing command-line option. - Continue supporting
TIKA_API_KEYas the preferred non-interactive input, while warning users not to place it in committed shell profiles, public configuration files, or logged automation output. - Add an interactive credential-entry mode using
getpass.getpass()so the key is not echoed or stored in ordinary shell history. - For durable storage, use an operating-system credential store or keyring rather than a plaintext JSON file where feasible.
- If plaintext caching remains supported, retain mode
0600, reject symlinks, verify file ownership, and use atomic file creation and replacement to reduce local file-manipulation risks. - Remove all documentation examples that instruct users to disclose credentials in AI-agent conversations.
- Replace secret-bearing examples with instructions for users to configure the environment variable themselves outside the conversation.
- Warn users that command-line arguments, chat messages, logs, screenshots, and shell history are unsafe places for API keys.
- Document credential rotation and revocation procedures for keys that may already have been exposed.
- Ensure authentication-status output remains masked and never prints either component of the key in full.
- Deprecate and remove
