T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:103- Finding
Mandatory Inspection of Credential-Bearing Files and Environment Variables
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Trails integration helper, but it needs Review because it asks agents to inspect API-key locations and includes copyable high-impact blockchain transaction examples without enough safeguards.
Review this skill before installing. If you use it, do not let the agent print or read API-key values; prefer user confirmation or existence-only checks. Pin skill and npm package versions, use testnets first, require explicit human confirmation before signing or executing transactions, and add authentication, authorization, schema validation, rate limits, recipient/token/chain allowlists, slippage limits, replay protection, and audit logging before deploying any generated backend or DeFi code.
SKILL.md:103Mandatory Inspection of Credential-Bearing Files and Environment Variables
SKILL.md:138Forced Use of Unpinned Latest Dependencies
docs/API_RECIPES.md:620Unauthenticated Backend Routes Proxy Privileged Transaction Operations
docs/TROUBLESHOOTING.md:94Troubleshooting Guidance Prints and Discloses API-Key Material
docs/HEADLESS_SDK_RECIPES.md:58Automatic Transaction Execution Is Presented Behind Inert Action Buttons
Success! Intent ID: {quote?.intentId}
} {isError &&Error: {error?.message}
} ); } ``` ``` The rendered `Send` button has no `onClick` handler, while the documentation explicitly states that the hook executes automatically. ### Technical Analysis The example makes the visible action button appear to control transaction initiation, but the button is inert. Instead, the transaction hook activates as soon as its parameters are considered ready. In dynamic swap and deposit examples, completing the final input can make the hook parameters non-null and start the flow without a deliberate click on the displayed `Swap` or `Deposit` button. Although wallet software may still request a signature, the application has ...[truncated 1463 chars]snippets/calldata-viem.ts:162Liquidity Calldata Defaults to Zero Minimum Output
The skill explicitly tells the agent to search .env files, environment variables, and configuration for API keys before doing anything else. In an agent context, this is credential discovery behavior that can expose secrets unrelated to the current task, and the broad instruction lacks minimization, consent, and clear boundaries on what may be read or revealed.
Create an account (or sign in) 2. Generate your API key
Once you have your key, add it to your .env file:
Then show them the environment variable format:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Generate a new API key 4. Copy the key
Once you have your key, add it to your .env file and let me know!
Wait for confirmation that they have the key before proceeding.
The batch settlement example iterates over recipients and executes treasury-funded cross-chain transfers in a loop, but it lacks a clear warning that it can perform repeated real payouts. In practice, this is especially risky for backend automation because a configuration error, malformed input, or unsafe agent behavior could rapidly drain treasury funds across many destinations.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# .env.local
TRAILS_API_KEY=sk_... # Server-side only
NEXT_PUBLIC_TRAILS_API_KEY=pk_... # Client-side (exposed)
The README instructs users to run npx skills add 0xsequence-demos/trails-skills without pinning a specific package/version, which allows whatever package version is current at execution time to run code on the user's machine. In the context of an agent skill installer, this increases supply-chain risk because a compromised package, hijacked dependency, or malicious future release could be fetched and executed implicitly.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const receipt = await trails.executeIntent({ intentId });
// Or Raw Fetch (Universal)
const quote = await fetch('https://api.trails.build/quote', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}` },
body: JSON.stringify({ ...params })
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const receipt = await trails.executeIntent({ intentId });
// Or Raw Fetch (Universal)
const quote = await fetch('https://api.trails.build/quote', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}` },
body: JSON.stringify({ ...params })
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const receipt = await trails.executeIntent({ intentId });
// Or Raw Fetch (Universal)
const quote = await fetch('https://api.trails.build/quote', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}` },
body: JSON.stringify({ ...params })
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const receipt = await trails.executeIntent({ intentId });
// Or Raw Fetch (Universal)
const quote = await fetch('https://api.trails.build/quote', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}` },
body: JSON.stringify({ ...params })
The activation triggers include broad terms like swap, payments, and cross-chain, which can cause the skill to auto-activate in contexts where the user did not intend to invoke it. In an AI agent environment, overbroad trigger matching can expand the skill's influence over prompts and code generation, increasing the chance of unintended actions or leakage of contextual project data to the skill workflow.
This repeats the same unpinned npx skills add installation pattern later in the README, again encouraging execution of a mutable remote package. Repetition increases exposure because users are more likely to copy-paste the command without reviewing provenance or version constraints.
The installation verification section reinforces vague trigger phrases such as bridge, swap, and cross-chain without defining strict activation conditions. This makes accidental invocation more likely and is more dangerous in this skill because it is designed to steer implementation choices, environment setup, and API usage once activated.
The skill instructs the agent to inspect environment files/variables and to access external documentation and API endpoints, but it declares no explicit tool scope or allowed-tools boundary. In an agent system, missing capability scoping can permit unnecessary access to secrets and network resources, increasing the blast radius if the skill is invoked unexpectedly or manipulated by prompt/context injection.
Broad cross-chain and DeFi terms create weak activation boundaries for a skill with sensitive behaviors. This makes it easier for unrelated requests to invoke the skill and inherit its instructions to probe the environment and use network resources.
These triggers are ambiguous and common across Web3 and general product discussions, making accidental activation likely. Because the skill can lead the agent to inspect local configuration and suggest credential setup flows, unintended invocation materially increases exposure risk.
The trigger phrases in this range include generic payment and token-related language that is likely to match many normal developer conversations. Overbroad activation can cause the skill to run outside its intended context, which is especially risky here because the skill encourages env inspection and outbound network usage.
The example walks through quote, commit, execute, and completion of a cross-chain transfer, but it does not explicitly warn that these steps can trigger real token movement and other irreversible financial effects once a valid signature is provided. In an AI-agent and automation context, omission of such warnings increases the risk that integrators treat the sample as a harmless demo and wire it into autonomous flows without adequate human confirmation or spending limits.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
def quote_intent(params):
response = requests.post(f"{TRAILS_API_URL}/quote", json=params, headers=headers)
response.raise_for_status()
return response.json()
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return response.json()
def commit_intent(quote_id):
response = requests.post(f"{TRAILS_API_URL}/intent/commit",
json={"quoteId": quote_id}, headers=headers)
response.raise_for_status()
return response.json()
The guide explicitly promotes executing arbitrary destination-chain contract calls after bridging/swapping tokens, but the nearby text does not clearly warn that users may irreversibly transfer assets into untrusted or incompatible contracts. In a cross-chain payments/DeFi skill, this is more dangerous because mistakes are harder to recover from and destination execution can compound bridge, swap, and contract-call risk into a single irreversible flow.
The liquidity example sets minLpTokens to 0 and comments that this means no slippage protection, which normalizes an unsafe default without an adjacent warning about sandwiching, severe price movement, or value loss. In a DeFi/cross-chain context, this is particularly risky because users may face compounded execution uncertainty and receive materially worse outcomes by the time the destination call executes.
The documentation shows useQuote examples that execute automatically when parameters are present, including real recipient addresses, token addresses, and amounts, but does not prominently warn that these snippets can initiate actual swaps or transfers once integrated. In a cross-chain payments skill, this is particularly risky because developers may copy-paste examples into production UIs and unintentionally create flows that trigger wallet signing and fund movement without an explicit user-initiated action boundary.
The documentation explicitly instructs users to place a client-side API key in a NEXT_PUBLIC_ environment variable, which makes the key readable by any browser user. Even if the platform intends this key to be public, the docs provide no warning about exposure, scope restrictions, or abuse controls, which can lead integrators to treat it like a secret and rely on it for trust or quota protection.
The markdown instructs users to place the API key in NEXT_PUBLIC_TRAILS_API_KEY, which in typical Next.js usage makes the value available in client-side bundles. Because this affects credential exposure and privacy/security posture, the doc should explicitly warn readers that the key is public-scoped and must not be a secret key.
This markdown describes pay, swap, fund, and post-bridge calldata execution flows that can move assets or trigger on-chain contract actions, but it does not include cautionary language about reviewing chain, recipient, token, amount, and transaction irreversibility. For markdown files, user-facing warnings are expected when behaviors may affect user funds or system integrity.
Detected: suspicious.env_credential_access