T09 · Insecure Skill Coding Practices
- Location
scripts/nexapi.py:13- Finding
API credentials and sensitive request parameters can be redirected to an untrusted server
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a plausible NexAPI client, but it can store your API key in plaintext and can send it to a configurable, undocumented endpoint, so it should be reviewed before installing.
Install only if you trust the NexAPI service and the environment running the skill. Avoid setting NEXAPI_BASE_URL unless you fully trust the destination, prefer environment-based API keys over local plaintext storage in shared systems, and check the generated config file permissions after using auth set.
scripts/nexapi.py:13API credentials and sensitive request parameters can be redirected to an untrusted server
scripts/nexapi.py:77API key is persisted in plaintext without enforced restrictive file permissions
The request target is built from BASE_URL and HEALTH_PATH, both sourced from environment variables, and then fetched over the network. If an attacker can influence these variables, they can redirect the skill to arbitrary internal or external endpoints, creating an SSRF primitive and allowing API discovery data to be spoofed, which is especially relevant because the wrapper trusts the returned API metadata.
url = BASE_URL + HEALTH_PATH + separator + urllib.parse.urlencode({"sort": "hot"})
try:
req = urllib.request.Request(url, headers={"Accept": "application/json"})
with urllib.request.urlopen(req, timeout=12) as resp:
payload = json.loads(resp.read().decode("utf-8", errors="ignore"))
except Exception:
return {}
The code sends authenticated requests to a URL derived from environment-controlled BASE_URL and remotely discovered API paths, attaching the X-API-Key header. An attacker who can change the base URL or poison the API cache/discovery response can cause the client to exfiltrate its API key to an attacker-controlled server or probe internal services, making this more dangerous than a generic wrapper because secrets are forwarded automatically.
req = urllib.request.Request(url, data=data, headers=headers, method=method)
try:
with urllib.request.urlopen(req, timeout=15) as resp:
raw = resp.read()
ctype = (resp.headers.get("Content-Type") or "").lower()
if "application/json" in ctype:
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
Referenced artifact was not completely inspected
python3 scripts/nexapi.py call ip-location ip=8.8.8.8
The skill clearly instructs the agent to use network access, read environment variables, and read/write local files for API key and cache persistence, but it does not declare any explicit tool scope or permissions boundary. This creates an authorization ambiguity: a host system or user cannot easily tell, before execution, that the skill can access sensitive local state and make outbound requests, increasing the risk of over-privileged execution or unintended data exposure.