T09 · Insecure Skill Coding Practices
- Location
scripts/patents.sh:3- Finding
Hard-Coded SerpApi Credential Exposed and Transmitted in URL Query Strings
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Google Patents skill mostly matches its stated purpose, but it ships a hardcoded SerpApi key and can write downloaded PDFs to caller-chosen paths.
Review before installing. Use only with your own SerpApi key after removing or rotating the embedded fallback key, avoid confidential patent queries unless you are comfortable sending them to SerpApi and fetched patent URLs, and be careful with the pdf output path because it can write wherever the invoking agent has filesystem permission.
scripts/patents.sh:3Hard-Coded SerpApi Credential Exposed and Transmitted in URL Query Strings
The documented behavior understates the actual security-relevant actions: the skill relies on a third-party authenticated service (SerpApi), downloads and writes PDFs to local storage, and the finding indicates a hardcoded default API key fallback. This mismatch is dangerous because it can hide data egress, local file writes, and secret-handling risks from users and policy enforcement, and a baked-in key could expose unauthorized external service usage or credential leakage.
The script embeds a hardcoded fallback SerpAPI key, causing anyone who runs the skill without setting SERPAPI_API_KEY to use the same credential. This risks credential leakage, unauthorized API usage, quota exhaustion, billing abuse, and makes secret rotation and ownership tracking difficult.
The skill advertises executable shell commands and network-backed behavior but does not declare any explicit tool scope such as allowed-tools or permissions. That creates a least-privilege failure: an agent or reviewer cannot clearly constrain or audit what external access the skill requires, increasing the chance of unintended command execution or network use beyond user expectations.
The search action constructs a request containing the user's query and sends it to SerpAPI, but the script's help output does not warn that user-provided search terms are transmitted over the network to a third party. Under the code-file criteria, network calls that transmit user or system data should have some user disclosure.
The manifest describes searching Google Patents for research, infringement checks, and IP analysis, which implies retrieval and analysis of patent data. The pdf action goes further by saving a remote PDF to a user-specified local path, which is a file-writing behavior not conveyed by the description's search/analysis framing.
The pdf command writes to an arbitrary local path through the user-controlled outfile argument without path restrictions or confirmation. In an agent setting, this broad file-write capability can be abused to overwrite files in unintended locations, making the skill more dangerous than a pure search/read-only tool.
The script performs a local file write during PDF download without warning, confirmation, or confinement to a safe location. In an agent context, undisclosed filesystem modification can surprise operators and can be leveraged to place files where they were not intended, especially when the output path is caller-controlled.
No suspicious patterns detected.