T09 · Insecure Skill Coding Practices
- Location
scripts/search.py:131- Finding
RIDB API Key Exposure Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search.py, lines 131 and 160–166
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: MediumVulnerable Code
python parser.add_argument("--api-key", help="RIDB API key (or set RIDB_API_KEY)")python result = search_facilities( lat=lat, lon=lon, radius=args.radius, limit=args.limit, activity=activity, api_key=args.api_key, )Technical Analysis
The CLI permits users to provide the RIDB API key through the
--api-keyargument. Command-line arguments are not an appropriate secret-transport mechanism because they may be exposed through:- Shell history files
- Process inspection utilities and process metadata
- Audit or endpoint-monitoring systems
- CI/CD job logs
- Terminal recordings and copied command transcripts
- Wrapper scripts or orchestration platforms that record invocation arguments
The implementation also supports
RIDB_API_KEY, which is preferable, but the presence and documentation of the command-line option encourage an insecure credential-handling path.The outbound use of the key itself is consistent with the Skill's declared functionality: it is transmitted in an HTTP header over HTTPS only to the documented RIDB endpoint. No evidence was found that the key is sent to Nominatim or any undisclosed host.
Attack Path
- A user invokes the tool with
python scripts/search.py --api-key SECRETand supplies search parameters. - The complete invocation is retained in shell history, automation logs, or terminal recordings, or is temporarily visible through local process inspection.
- Another local principal, administrator, monitoring service, or person with access to those records extracts
SECRET. - The party uses the recovered credential to make authenticated RIDB requests under the victim's API identity.
Exploitation requires acc ...[truncated 588 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
--api-keycommand-line option and obtain the credential fromRIDB_API_KEY. - For interactive use, optionally support a non-echoing prompt through
getpass.getpass()when the environment variable is absent. - For automation, support a credential store or a permission-restricted secret file rather than exposing the value in process arguments.
- Do not include credential values in exceptions, debug messages, telemetry, or logs.
- Update
README.md,SKILL.md, and CLI help to demonstrate only secure credential-loading methods. - If backward compatibility requires retaining
--api-key, deprecate it, emit a prominent warning, and advise users to rotate any key previously exposed through command history or logs.
- Remove the
