T09 · Insecure Skill Coding Practices
- Location
SKILL.md:85- Finding
Google Maps API Key Exposed Through Process Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 85–89
Vulnerability Type: Secret exposure through command-line arguments
Risk Level: MediumVulnerable Code
bash python3 scripts/drive_time.py \ --origin "<your address>" \ --dest "Seattle-Tacoma International Airport" \ --api-key "$(cat scripts/data/google_maps_api_key.txt)" \ --jsonTechnical Analysis
The documented command reads the Google Maps API key from a local file and expands it directly into the spawned process's argument list. Although the key is stored in a file initially, shell substitution causes its plaintext value to appear in
argv.Depending on operating-system permissions and monitoring configuration, command-line arguments may be observable through process inspection interfaces such as
/proc, process-management utilities, audit logs, crash reports, job schedulers, or endpoint-monitoring software. This exposes the credential more broadly than required for the declared drive-time functionality.The behavior does not grant operating-system privileges directly. It may, however, disclose the Google Maps credential and grant an attacker the API access, quota, and billing capabilities assigned to that key.
Attack Path
- A user or scheduled agent invokes the documented drive-time command.
- The shell reads
scripts/data/google_maps_api_key.txtand inserts the key into the--api-keyargument. - A local process, monitoring agent, or user with sufficient process-inspection access observes the command line while the process is active or retrieves it from retained diagnostic logs.
- The observer extracts the plaintext API key.
- The observer submits requests to Google APIs permitted by the key.
- If the key lacks API, application, quota, or billing restrictions, the attacker consumes quota, incurs charges, or accesses other services enabled for the same key.
Impact Assessment
Explo ...[truncated 441 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not pass API keys through command-line arguments.
- Modify the drive-time implementation to read the credential internally from a permission-restricted file or a dedicated secret manager.
- If environment-variable delivery is necessary, ensure the execution environment does not expose environment values to unauthorized processes or logs.
- Set the key file permissions to allow access only to the account running the Skill.
- Restrict the Google API key to the specific APIs required by the Skill.
- Apply supported application restrictions, conservative quotas, billing alerts, and usage monitoring.
- Ensure schedulers, error reports, and audit systems redact secret values.
- Rotate the key if it has previously appeared in process or scheduler logs.
