T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:303- Finding
Overbroad Wildcard Network Egress Permission
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent for Elfa API access, but it needs Review because its x402 examples can spend real USDC without a clear per-call consent gate.
Review before installing if you plan to use x402. Prefer API-key mode via ELFA_API_KEY, allow only api.elfa.ai for network access, never paste or hardcode wallet private keys, and only run x402 requests with an explicit spend limit or low-balance wallet after confirming the expected cost.
SKILL.md:303Overbroad Wildcard Network Egress Permission
SKILL.md:182Private-Key Hardcoding Pattern in x402 Example
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
Do not attempt any authenticated API calls without a key or x402 setup. Wait for the user.
3. **Credential safety:**
- Always read the API key from the `ELFA_API_KEY` environment variable, never ask the
user to paste it into the conversation.
- Never log or expose the full API key in outputs — mask it when displaying curl commands.
- If a user does paste a key in chat, warn them to rotate it and set it as an env var instead.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Making the call:
curl -s -H "x-elfa-api-key: $ELFA_API_KEY" "https://api.elfa.ai/v2/aggregations/trending-tokens?timeWindow=24h&pageSize=10"
The skill documents x402 payment flows and even recommends wrappers that automatically retry paid requests, but it does not require an explicit user confirmation that real USDC may be spent. In an agent setting, this creates a meaningful risk of unintended financial transactions if the model follows the skill for a live request without making the cost and spending consequence unmistakably clear.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
libraries. The agent never handles, stores, or transmits private keys.
- The user's wallet private key is used only locally by the x402 library to sign
EIP-712 typed data authorizing a specific USDC amount for a specific request.
- Never ask the user to share their wallet private key or seed phrase in the conversation.
- When generating x402 code examples, use `"0xYOUR_PRIVATE_KEY"` as a placeholder and
advise the user to load it from an environment variable (e.g., `process.env.PRIVATE_KEY`).
This example initiates an x402 request flow that is designed to obtain payment requirements and proceed toward a paid request, yet it is presented as a routine call without a strong financial-risk warning. In an agent context, showing live commands that can trigger a spend path increases the chance of unintended paid interactions with an external service.
# Step 1: Send request without payment — get 402 with payment requirements
curl -s https://api.elfa.ai/x402/v2/aggregations/trending-tokens?timeWindow=24h
# Step 2: After signing the payment payload with your wallet, resend with X-PAYMENT header
curl -s -H "X-PAYMENT: <base64-encoded-payment-payload>" \
This example shows resending the request with an X-PAYMENT header, which represents the billable step of the x402 flow. Without an explicit requirement for informed user consent, an agent could reproduce or encourage a real paid request that spends USDC.
curl -s -H "X-PAYMENT: "
"https://api.elfa.ai/x402/v2/aggregations/trending-tokens?timeWindow=24h"
**Recommended: use the `@x402/fetch` library** which handles payment automatically:
The x402Fetch wrapper is described as automatically handling payment on 402 responses, which materially lowers friction for spending real funds. In an autonomous-agent environment, automatic payment handling without a mandatory user-approval step is risky because a normal-looking fetch can silently become a paid transaction.
// Use x402Fetch exactly like regular fetch — payment is handled automatically on 402 responses const response = await x402Fetch( "https://api.elfa.ai/x402/v2/aggregations/trending-tokens?timeWindow=24h"); const data = await response.json();
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
x402 with the Chat endpoint (POST):
const response = await x402Fetch(
"https://api.elfa.ai/x402/v2/chat",
{
method: "POST",
This paid chat example uses x402Fetch for a POST call, meaning message contents are sent externally and payment may be handled automatically. The combination of data transmission and implicit billing is dangerous in an agent workflow if the user is not clearly warned that both sensitive prompts and real funds may be involved.
const response = await x402Fetch(
"https://api.elfa.ai/x402/v2/chat",
{
method: "POST",
headers: { "Content-Type": "application/json" },
No suspicious patterns detected.