T09 · Insecure Skill Coding Practices
- Location
scripts/build-service-request.mjs:122- Finding
API Key Exposed in Generated User-Visible Curl Command
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its AICADE service-management purpose, but it silently reuses local API credentials and prints authenticated curl commands that can expose or enable sensitive operations.
Review before installing. Use this only if you are comfortable with the agent checking AICADE_API_KEY and AICADE_API_SECRET_KEY from the local environment and generating signed administrative curl commands. Avoid putting real API keys or upstream secrets into chat transcripts or logs, prefer redacted or environment-variable-based curl output, and carefully confirm the base URL and serviceId before any disable operation.
scripts/build-service-request.mjs:122API Key Exposed in Generated User-Visible Curl Command
Referenced artifact was not completely inspected
Use `scripts/build-service-request.mjs` to print signed curl. The script generates:
Referenced artifact was not completely inspected
Use `scripts/build-service-request.mjs` to print signed curl. The script generates:
The skill invokes local shell commands and accesses environment-derived secrets, but it does not declare an explicit tool/permission scope. That creates a governance gap where a user or host system may not realize the skill can execute code or touch sensitive local context, increasing the chance of unintended command execution and secret exposure.
The skill explicitly tells the agent to check local environment variables and reuse API credentials without asking the user again, but provides no user-facing consent or warning. This can lead to silent access to sensitive credentials and use of them in generated signed requests, which is especially risky because the skill is designed around authentication material and request signing.
The instruction to 'use existing local values without asking again' authorizes autonomous use of sensitive local credentials. Even if the script only prints curl, the resulting signed request material can enable privileged operations such as service registration or disablement without a fresh user approval step.
node {baseDir}/scripts/build-service-request.mjs env-check --operation disable
Use existing local values without asking again:
- `AICADE_API_KEY`: sent as `X-API-Key`
- `AICADE_API_SECRET_KEY`: used to generate `X-Signature`
The example config sends the upstream API key in the URL query string via authLocation: QUERY and queryParam: key. Query parameters are commonly logged by clients, proxies, gateways, load balancers, and observability tools, so this pattern increases the chance of credential leakage even if HTTPS is used. In a service-registration skill, users may copy this example directly into production, making the insecure pattern more likely to propagate.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
{
"serviceId": "my-service-01",
"serviceName": "My Service",
"endpointUrl": "https://api.example.com/v1/endpoint",
"requestMethod": "POST",
"authType": "NONE",
"authLocation": "HEADER",
The phrase 'do not ask the user to confirm it' directs the agent to make a security-relevant decision autonomously about credential usage. Autonomous handling of secrets reduces transparency and removes an important human approval checkpoint, making accidental or unauthorized authenticated actions more likely.
node {baseDir}/scripts/build-service-request.mjs env-check --operation register
If `AICADE_API_KEY` exists locally, use it and do not ask the user to confirm it.
If `AICADE_API_SECRET_KEY` exists locally, use it and do not ask the user to confirm it.
The skill explicitly instructs the agent to discover and use locally stored API credentials without disclosing that behavior to the user. In an agent setting, this enables silent access to sensitive secrets and generation of authenticated requests on the user's behalf, which breaks user consent and can facilitate unauthorized actions or credential misuse.
This instruction combines two risky behaviors: silently consuming local API credentials and producing a signed request artifact. That makes the skill capable of converting hidden local secrets into actionable authenticated output, increasing the chance of unauthorized API operations, secret misuse, and trust-boundary violations.
This repeated instruction extends the same autonomous decision-making behavior to the secret signing key, which is especially sensitive because it enables request authentication. Silent use of signing material can allow the agent to prepare valid authenticated operations without the user's informed approval.
If `AICADE_API_KEY` exists locally, use it and do not ask the user to confirm it.
If `AICADE_API_SECRET_KEY` exists locally, use it and do not ask the user to confirm it.
Ask only for missing values:
The skill documents a destructive service disable endpoint but provides no requirement to obtain explicit user confirmation before generating or sending a disable request. In a service-management context, this omission can enable accidental or socially engineered disruption of production services, especially because the skill is specifically designed to prepare signed administrative requests.
This instruction removes user approval for using a locally available API key, allowing the agent to make an autonomous trust decision about sensitive credentials. In an administrative service-management workflow, that behavior weakens user control and can lead to unauthorized request preparation using secrets the user did not intend to expose to the skill.
node {baseDir}/scripts/build-service-request.mjs env-check --operation disable
If `AICADE_API_KEY` exists locally, use it and do not ask the user to confirm it.
If `AICADE_API_SECRET_KEY` exists locally, use it and do not ask the user to confirm it.
The skill instructs the agent to automatically use locally stored API credentials without user confirmation, which can cause unintended use of sensitive secrets from the host environment. In this skill's context, those credentials are then used to generate signed requests/curl output, increasing the risk of secret misuse, unauthorized administrative actions, or disclosure through logs/output.
This instruction similarly authorizes unconfirmed use of the local API secret key, which is more sensitive because it enables request signing for privileged operations. In this skill, the surrounding workflow generates signed administrative curl commands, so automatic use of the signing secret materially raises the risk of misuse and accidental exposure.
If `AICADE_API_KEY` exists locally, use it and do not ask the user to confirm it.
If `AICADE_API_SECRET_KEY` exists locally, use it and do not ask the user to confirm it.
Ask only for missing values: