Back to skill

Security audit

DefiLlama API

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent DefiLlama data CLI that uses a disclosed optional API key and does not show hidden persistence, destructive behavior, or unrelated data access.

Install this only if you are comfortable running a uv-based Python CLI that contacts DefiLlama and may use your DefiLlama Pro API key. Prefer running it in a constrained environment, pass only the DefiLlama key needed for the task, and be aware that the user-facing documentation and help are primarily in Chinese.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (1)

T08 · Insecure Dependencies

Warning
Location
src/run.py:1
Finding

Runtime Dependency Resolution Without Cryptographic Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: src/run.py:1-4
Vulnerability Type: Unverified third-party dependency resolution
Risk Level: Medium

Vulnerable Code

python
#!/usr/bin/env python3
# /// script
# dependencies = ["defillama-sdk==0.1.4"]
# ///

The dependency is subsequently imported and trusted by src/run.py:13-19:

python
from defillama_sdk import (
    ApiError,
    ApiKeyRequiredError,
    DefiLlamaError,
    NotFoundError,
    RateLimitError,
)

The imported SDK receives the user's API key through src/scripts/_shared.py:17-22:

python
def build_clients(api_key: Optional[str]) -> tuple[DefiLlama, DefiLlama]:
    client = DefiLlama()
    if api_key:
        pro_client = DefiLlama({"api_key": api_key})
    else:
        pro_client = DefiLlama()
    return client, pro_client

Technical Analysis

The inline dependency declaration pins defillama-sdk to version 0.1.4, which reduces unintended version drift but does not cryptographically bind execution to a reviewed package artifact. The project contains no lockfile with artifact hashes, vendored dependency, or explicit trusted package-index configuration.

The documented invocation pattern uses uv run, which may resolve and install the declared dependency when a prepared environment is unavailable. Package imports execute Python module initialization code with the same operating-system privileges as the caller. Consequently, a compromised or substituted package artifact could execute before the Skill processes a command.

This dependency is security-sensitive because the SDK is given the optional DEFILLAMA_API_KEY value. Malicious initialization or client-construction code could read that credential, access other data available to the process, or perform arbitrary actions permitted to the user.

Attack Path

  1. The user invokes a documented command such as uv run src/run.py ... ...[truncated 1633 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create and commit a uv.lock file that records the exact dependency artifacts and cryptographic hashes.
  2. Execute dependency installation and Skill commands in locked or frozen mode so resolution fails rather than silently selecting an unreviewed artifact.
  3. Configure an explicit, trusted Python package index and disable unintended fallback indexes.
  4. Prefer installing dependencies during a controlled setup phase instead of resolving packages during each command invocation.
  5. Verify the provenance and published hashes of defillama-sdk==0.1.4 before deployment.
  6. Run the Skill with least privilege and expose only the required environment variable.
  7. Rotate the DefiLlama API key immediately if dependency compromise is suspected.
  8. Audit and deliberately update the lockfile whenever the SDK version changes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (20)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill explicitly exposes command-line access to a Python runner that uses environment variables and makes network requests, but it does not declare any explicit tool scope such as allowed tools or permissions. This weakens policy enforcement and reviewability, increasing the chance the skill can access broader environment data or perform unintended outbound requests when invoked in an agent context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description is written entirely in Chinese and presents the skill's usage guidance in that language, which can impose a locale/language constraint on users without opt-in. The file does not indicate that Chinese is optional, selectable, or required for a documented region-specific reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code includes user-facing help text and runtime error messages in Chinese, while other text is in English, with no option for the user to choose locale. That creates a natural-language policy issue because the skill imposes a specific language/locale in its interface without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The error messages at runtime include Chinese text and are presented automatically to all users. Because there is no explicit locale selection or documented regional constraint, this is a policy-relevant language enforcement issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing help strings for the command and arguments are written in Chinese throughout the file, which imposes a specific language on users of the skill. There is no indication that the tool is region-specific or that users can select another language, so this appears to violate the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The command and argument help strings are written only in Chinese, imposing a specific language in the user-facing interface. The file provides no opt-in, locale selection, or justification that this skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing help strings for the command and subcommands are written exclusively in Chinese across the CLI definition. This imposes a specific language on all users without offering an alternative locale or documenting that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The command and argument help strings are written in Chinese throughout the file, which imposes a specific language on users without any visible opt-in or alternative locale support. The provided policy flags language or locale constraints unless the skill offers user choice or clearly documents a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The raised ValueError uses a hard-coded Chinese message ("无效 JSON") in a shared helper. This imposes a specific language on users and callers without offering any locale choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This code issues multiple client calls to retrieve price and blockchain data, which likely involves outbound network requests, but the file contains no confirmation prompt, logging, comments, or docstrings disclosing that external data access occurs. For a code-file review under SQP-2, these operations can be flagged when no user disclosure is present in the file and the warning is not otherwise evident here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The user-facing help strings for the command and arguments are written only in Chinese (for example, "DAT 数据(Pro)", "机构列表", and "机构详情") with no indication of language selection or opt-in. This creates a locale/language policy concern because the skill presents a fixed language experience rather than offering a choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The command help strings are written only in Chinese (for example, ETF 数据(Pro), 比特币 ETF 概览, and 以太坊 ETF 流入流出历史), which can constitute a language/locale policy issue when no user opt-in or alternative locale is offered. The file does not indicate that the skill is region-specific or that users can select another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The command and argument help strings are presented in Chinese (for example, '费用与收入数据', '链费用概览', and '协议 slug') with no indication that language is configurable or intentionally limited to a Chinese-only audience. This can violate a language/locale policy when a skill imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The parser help strings are written in Chinese throughout the command registration, which imposes a specific language/locale in the user-facing interface. There is no visible opt-in, language selection, or documentation in this file justifying a locale-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The user-facing help strings are written only in Chinese ("账号与配额(Pro)" and "API 使用量"), which imposes a specific language choice in natural-language text. There is no indication of locale selection or user opt-in, so this appears to violate the language/locale policy for skills intended for general use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The user-facing help strings are written in Chinese (for example, '叙事表现(Pro)', 'FDV 表现', and '周期(例如 30)') with no indication that language selection is optional or region-specific. This creates a natural-language locale constraint in the skill interface without documented opt-in, which matches the language policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The command and argument help strings are presented only in Chinese (for example, '永续合约数据', '未平仓量', and '协议 slug') with no indication that users can select a preferred language or locale. This is a natural-language policy concern because the skill imposes a specific language without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The command and argument help strings are written only in Chinese (for example, "稳定币数据", "稳定币列表", and "链名"), which imposes a specific language on users without offering a locale choice. This is a natural-language policy issue because the file hardcodes a language preference rather than making it optional or clearly documenting a justified locale constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This code performs an HTTP GET using an authenticated client, which may transmit user or account-scoped data to a remote service. There is no visible confirmation, logging, print statement, or explanatory comment/docstring in this file disclosing that a network call with authentication occurs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing help strings for the command and argument descriptions are written only in Chinese, which imposes a specific language on users without opt-in. Under the stated policy, language constraints should either offer a choice or be clearly justified as locale-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.