Back to skill

Security audit

Defillama Data Aggregator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent DefiLlama data-query CLI, but users should be aware of insecure optional network configuration and CSV/terminal output hardening gaps.

Install only if you are comfortable with an npm-based CLI that contacts DefiLlama public APIs. Avoid enabling any direct-IP HTTPS configuration, treat CSV exports as untrusted before opening them in spreadsheets, and prefer a lockfile or reviewed pinned dependencies for production use.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
src/utils/api-client.js:68
Finding
Direct-IP Mode Disables TLS Certificate Verification<![CDATA[ ## Vulnerability Details **File Location**: `src/utils/api-client.js:68-89` **Vulnerability Type**: Improper certificate validation **Risk Level**: Medium ```javascript // IP direct mode: replace URL and set Host header if (this.useIpDirect && this.ipBaseUrl && options.url) { // Replace baseUrl with IP direct address const originalUrl = new URL(options.url); const ipUrl = new URL(this.ipBaseUrl); // Keep original path and query params, only replace protocol and host const newUrl = `${this.ipBaseUrl}${originalUrl.pathname}${originalUrl.search}`; requestConfig.url = newUrl; // Set Host header (SNI) if (this.hostHeader) { requestConfig.headers['Host'] = this.hostHeader; } // For HTTPS IP direct, need to disable certificate verification (certificate is for domain) if (ipUrl.protocol === 'https:') { requestConfig.httpsAgent = new https.Agent({ rejectUnauthorized: false }); } } ``` ### Technical Analysis When direct-IP mode is enabled, the HTTP client creates an HTTPS agent with `rejectUnauthorized: false`. This disables certificate-chain and endpoint-identity validation, allowing any certificate to be accepted. The constructor also reads a `rejectUnauthorized` configuration value, but this value is not used when creating the HTTPS agent. Consequently, the direct-IP branch disables verification unconditionally. Direct-IP routing is not enabled by the supplied default configuration, so exploitation requires an operator or deployment configuration to enable `useIpDirect` and set `ipBaseUrl`. Once enabled, network traffic no longer receives normal TLS authentication. ### Attack Path 1. An operator enables `useIpDirect` and configures an HTTPS `ipBaseUrl`. 2. The Skill redirects API requests from the intended DefiLlama hostname to the configured IP address. 3. An attacker with a network interception position redirects or intercepts the connection. 4. The attacker presents an arbitrary, self-signed, expired, o ...[truncated 743 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the direct-IP TLS bypass and never set `rejectUnauthorized: false`. - Connect using the expected hostname so Node.js can perform normal certificate and hostname validation. - If direct-IP routing is operationally necessary, preserve the original hostname for SNI and explicitly verify the certificate against that hostname. - Use a properly configured DNS override or custom `lookup` function rather than replacing the URL hostname and disabling TLS checks. - Remove the unused `rejectUnauthorized` configuration option or enforce a secure value of `true`. - Add an automated test verifying that self-signed, expired, and hostname-mismatched certificates are rejected in every connection mode. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
src/utils/formatter.js:96
Finding
API-Controlled Terminal Escape Sequences Are Printed Without Sanitization<![CDATA[ ## Vulnerability Details **File Location**: `src/utils/formatter.js:96-98` **Vulnerability Type**: Terminal control-sequence injection **Risk Level**: Low ```javascript if (typeof value === 'string') { // Truncate long strings return value.length > 30 ? `${value.substring(0, 27)}...` : value; } ``` ### Technical Analysis String values obtained from external APIs are returned directly to the table formatter. Length truncation does not remove ASCII control characters, ANSI escape sequences, carriage returns, or other terminal control codes. If an upstream response contains a malicious protocol, pool, chain, project, or symbol value, displaying the response in table format can cause the user's terminal to interpret those bytes rather than render them as inert text. Normal exploitation requires control over an upstream response, such as compromise of the API, interception through an insecure transport configuration, or another mechanism capable of modifying returned data. ### Attack Path 1. An attacker gains the ability to influence a field in a DefiLlama API response. 2. The attacker inserts terminal control characters into a textual field. 3. The user runs a command with table output, such as a protocol or yield-pool query. 4. `formatCell()` passes the malicious string to `cli-table3` without removing control characters. 5. The resulting table is printed to the terminal. 6. The terminal interprets the embedded sequence, potentially altering displayed content, creating deceptive output, changing terminal state, or invoking terminal-specific features. ### Impact Assessment The attacker may spoof or conceal terminal output and misrepresent financial data. Depending on terminal capabilities and configuration, crafted sequences may also manipulate window titles, hyperlinks, or clipboard contents. This issue does not inherently provide system privileges or arbitrary code execution. Its direct scope is the active terminal session and the user's ...[truncated 40 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove ANSI escape sequences and non-printable control characters from all externally sourced strings before terminal output. - Preserve only expected printable Unicode characters, tabs, and normalized line breaks where required. - Apply sanitization before truncation so an escape sequence cannot survive inside the retained prefix. - Use a maintained terminal-sanitization library or a strict sanitizer such as: ```javascript const safe = String(value) .replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, '') .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, ''); ``` - Add tests containing ANSI color codes, cursor-control sequences, carriage returns, OSC sequences, and embedded newlines. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
src/utils/formatter.js:127
Finding
CSV Export Does Not Neutralize Spreadsheet Formulas<![CDATA[ ## Vulnerability Details **File Location**: `src/utils/formatter.js:127-140` **Vulnerability Type**: CSV formula injection **Risk Level**: Medium ```javascript const escapeCsv = (value) => { if (value === null || value === undefined) return ''; const str = String(value); if (str.includes(',') || str.includes('"') || str.includes('\n')) { return `"${str.replace(/"/g, '""')}"`; } return str; }; const header = keys.join(','); const rows = items.map(item => keys.map(key => escapeCsv(item[key])).join(',') ); ``` ### Technical Analysis The CSV formatter correctly escapes delimiters, quotation marks, and line breaks, but it does not neutralize spreadsheet formula prefixes. Values beginning with `=`, `+`, `-`, or `@` may be interpreted as formulas when the exported file is opened in spreadsheet software. CSV quotation does not reliably prevent formula evaluation. Because protocol and yield data originate from external API responses, an attacker who controls or alters an upstream field can place a spreadsheet formula in the generated CSV. ### Attack Path 1. An attacker controls or modifies a textual field returned by an upstream API. 2. The field is set to a formula-like value beginning with `=`, `+`, `-`, or `@`. 3. A user exports results using `--format csv` and saves the output to a file. 4. `escapeCsv()` performs ordinary CSV escaping but leaves the formula prefix intact. 5. The user opens the generated file in spreadsheet software. 6. The spreadsheet interprets the attacker-controlled cell as a formula. 7. Depending on the spreadsheet product and its security settings, the formula can trigger external requests, disclose spreadsheet data, present deceptive links, or invoke other formula-supported functionality. ### Impact Assessment Successful exploitation may disclose data accessible to the spreadsheet, cause outbound network requests, mislead the user, or trigger application-specific functionality. The practical effect depends o ...[truncated 252 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Detect formula-significant prefixes after trimming leading whitespace and control characters. - Prefix dangerous cells with an apostrophe or another spreadsheet-safe marker before applying normal CSV quoting. - Treat `=`, `+`, `-`, and `@` as dangerous prefixes. Also account for leading tabs, carriage returns, and whitespace that some spreadsheet applications ignore. - Consider offering separate raw CSV and spreadsheet-safe CSV modes, with the safe mode as the default. - Example hardening: ```javascript const escapeCsv = (value) => { if (value === null || value === undefined) return ''; let str = String(value).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, ''); if (/^[\s]*[=+\-@]/.test(str)) { str = `'${str}`; } return `"${str.replace(/"/g, '""')}"`; }; ``` - Add regression tests for formula prefixes, leading whitespace, tabs, embedded quotes, commas, and multiline values. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The documented behavior materially mismatches the detected capabilities and claimed features: the skill appears to access additional data classes not disclosed, while some advertised features are not actually implemented. This is dangerous because reviewers and users may make trust decisions based on inaccurate documentation, allowing unexpected network access or hidden functionality to pass under a benign description.

Missing User Warnings

High
Confidence
97% confidence
Finding
The code silently disables HTTPS certificate verification for IP-direct requests without any warning, confirmation, or guardrail. This makes insecure transport easy to enable accidentally and exposes API responses to tampering or interception, which is especially risky in a data aggregation component that may feed trading, monitoring, or reporting workflows.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill declares installation and runtime behavior that require network access and potentially environment interaction, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens sandboxing and reviewability because consumers cannot tell from the manifest what capabilities the skill expects, increasing the chance of overbroad execution in hosts that rely on metadata for policy enforcement.

External Transmission

Medium
Category
Data Exfiltration
Content
| Endpoint | Description |
|----------|-------------|
| `https://api.llama.fi/tvl` | Total DeFi TVL |
| `https://api.llama.fi/protocols` | All protocols |
| `https://api.llama.fi/protocol/{name}` | Protocol details |
| `https://api.llama.fi/chains` | All chains |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
| Endpoint | Description |
|----------|-------------|
| `https://api.llama.fi/tvl` | Total DeFi TVL |
| `https://api.llama.fi/protocols` | All protocols |
| `https://api.llama.fi/protocol/{name}` | Protocol details |
| `https://api.llama.fi/chains` | All chains |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
| Endpoint | Description |
|----------|-------------|
| `https://api.llama.fi/tvl` | Total DeFi TVL |
| `https://api.llama.fi/protocols` | All protocols |
| `https://api.llama.fi/protocol/{name}` | Protocol details |
| `https://api.llama.fi/chains` | All chains |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
| Endpoint | Description |
|----------|-------------|
| `https://api.llama.fi/tvl` | Total DeFi TVL |
| `https://api.llama.fi/protocols` | All protocols |
| `https://api.llama.fi/protocol/{name}` | Protocol details |
| `https://api.llama.fi/chains` | All chains |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
In IP-direct mode, the client creates an HTTPS agent with rejectUnauthorized set to false, which disables TLS certificate validation and allows man-in-the-middle interception or spoofed upstream responses. For a DeFi data aggregation skill, upstream integrity matters because manipulated protocol, TVL, or yield data could mislead downstream decisions, and direct-IP access is not justified enough to offset this risk.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"author": "AntalphaAI",
  "license": "MIT",
  "dependencies": {
    "axios": "^1.6.0",
    "chalk": "^4.1.2",
    "cli-table3": "^0.6.3",
    "commander": "^11.1.0",
Confidence
95% confidence
Finding
The dependency uses a caret range instead of an exact version, which makes builds non-reproducible and can silently pull in newly published releases. In a CLI/data-aggregator skill that depends on external packages, this increases supply-chain risk because a compromised or vulnerable upstream minor/patch release could be installed without review.

Unverifiable Dependency: axios has 16 known advisory(ies) (CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding
Axios has multiple known advisories, and because the manifest uses an unpinned range, it is impossible to verify from this file whether the installed version is affected. In a DeFi data aggregator that likely makes outbound HTTP requests, axios is a high-value dependency: unresolved SSRF, MITM, or prototype-pollution-related flaws could directly affect fetched data integrity and request handling.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"license": "MIT",
  "dependencies": {
    "axios": "^1.6.0",
    "chalk": "^4.1.2",
    "cli-table3": "^0.6.3",
    "commander": "^11.1.0",
    "node-cache": "^5.1.2"
Confidence
96% confidence
Finding
The chalk dependency is specified with a caret range, allowing automatic adoption of later compatible releases. This is more concerning here because static analysis also notes a malicious-package advisory associated with chalk, so leaving the version unpinned materially increases exposure to supply-chain compromise.

Unverifiable Dependency: chalk has 1 known advisory(ies) (MAL-2025-46969 (Malicious code in chalk (npm))), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding
The manifest does not pin chalk, so it is not possible to determine whether installations resolve to a release impacted by the cited malicious-package advisory. Even though chalk is primarily cosmetic, a malicious dependency can execute during installation or runtime and compromise the host environment, making this a meaningful supply-chain concern.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dependencies": {
    "axios": "^1.6.0",
    "chalk": "^4.1.2",
    "cli-table3": "^0.6.3",
    "commander": "^11.1.0",
    "node-cache": "^5.1.2"
  },
Confidence
93% confidence
Finding
Using a version range for cli-table3 permits non-deterministic dependency resolution across environments. While not an immediate exploit by itself, it increases the attack surface for supply-chain issues and makes it harder to verify exactly what code is being executed.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"axios": "^1.6.0",
    "chalk": "^4.1.2",
    "cli-table3": "^0.6.3",
    "commander": "^11.1.0",
    "node-cache": "^5.1.2"
  },
  "engines": {
Confidence
93% confidence
Finding
The commander package is not pinned to an exact release, so future installs may resolve to different code than originally tested. For a CLI entrypoint package, argument-parsing libraries are security-relevant because compromise or regression there can affect all command execution paths.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"chalk": "^4.1.2",
    "cli-table3": "^0.6.3",
    "commander": "^11.1.0",
    "node-cache": "^5.1.2"
  },
  "engines": {
    "node": ">=16.0.0"
Confidence
92% confidence
Finding
The node-cache dependency is declared with a caret range, allowing upstream patch/minor updates to be pulled automatically. This weakens build integrity and may introduce vulnerable or malicious code without any corresponding repository change.

Context-Inappropriate Capability

Low
Confidence
80% confidence
Finding
The manifest describes a DefiLlama data aggregator with output formatting, health monitoring, and security validation. In addition to those functions, the code loads local config files and later checks process.env.DEBUG to alter behavior, which are host-environment access capabilities not clearly justified by the stated purpose in this file.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This code performs network calls to third-party DefiLlama services, but there is no confirmation prompt, user-facing log, or warning in the file indicating that user-supplied query values may be sent externally. For a code file, outbound network transmission is a safety-relevant operation when it lacks any visible disclosure.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The getPoolYields method sends a request to a different third-party host, https://yields.llama.fi/pools, yet this file contains no user-facing warning or notice about the outbound call. This fits the missing-warning criterion for code files because network transmission occurs without visible disclosure.

Intent-Code Divergence

Low
Confidence
96% confidence
Finding
The constructor exposes a rejectUnauthorized configuration, but the IP-direct HTTPS path ignores it and always sets rejectUnauthorized to false. This creates a security-control bypass and can mislead operators into believing certificate verification is enabled when it is not, increasing the likelihood of insecure deployment.

Static analysis

No suspicious patterns detected.