Back to skill

Security audit

chord-charts

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Chord market-charting tool, but it writes externally supplied token symbols into SVG files without escaping them, which can let malicious token metadata alter the generated chart document.

Install only if you are comfortable with token chart requests being sent to Chord's API and avoid opening generated SVGs from loosely resolved symbols in a script-capable browser until the skill escapes SVG text such as token symbols, titles, and subtitles.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/chart.py:107
Finding

Unescaped External Token Metadata Injected into Generated SVG

Content
View full analysis

Vulnerability Details

File Location: scripts/chart.py:43-47, 57-62, 107-110, 150-155
Vulnerability Type: SVG/XML injection through unescaped external metadata
Risk Level: Medium

Complete Code Snippet

python
# Lines 43-47: Solana search results supply the symbol.
best = max(rows, key=lambda t: (t.get("symbol", "").lower() == query.lower(), t.get("liquidityUsd") or 0))
return best["token"], best.get("symbol")

# Lines 57-62: EVM search results supply the symbol.
best = max(hits, key=lambda t: (bool(t.get("verified")), t.get("liquidityUsd") or 0))
return best["address"].lower(), best.get("symbol")

# Lines 107-110: The title is inserted directly into SVG markup.
out = [f'<svg xmlns="http://www.w3.org/2000/svg" width="{W}" height="{H}" viewBox="0 0 {W} {H}" font-family="ui-monospace,Menlo,Consolas,monospace">',
       f'<rect width="{W}" height="{H}" fill="#0b0f0e"/>',
       f'<text x="{L}" y="30" fill="#e8ecea" font-size="20" font-family="system-ui,sans-serif" font-weight="700">{title}</text>',
       f'<text x="{L}" y="50" fill="#8a9590" font-size="12">{subtitle}</text>']

# Lines 150-155: The external symbol is placed in the title and written
# to the generated SVG file.
sym = sym or a.token[:10]
first, last = rows[0]["o"], rows[-1]["c"]
chg = (last / first - 1) * 100 if first else 0.0
vol = sum(r["v"] for r in rows)
trades = sum(r.get("n") or 0 for r in rows)
span = f'{dt.datetime.fromtimestamp(rows[0]["t"], dt.timezone.utc):%Y-%m-%d %H:%M} to {dt.datetime.fromtimestamp(rows[-1]["t"], dt.timezone.utc):%Y-%m-%d %H:%M} UTC'
title = f"{sym} · {a.chain} · {a.tf}   ${fmt_price(last)}  {chg:+.2f}%"

Technical Analysis

When a token is selected by symbol or name rather than by address, resolve() obtains its display symbol from the external Chord API. That value is assigned to sym, incorporated into title, and interpolated directly into an ...[truncated 1995 chars]

Remediation
View remediation

Remediation Suggestions

  • XML-escape every externally derived string before inserting it into SVG markup. For example, apply html.escape(value, quote=True) to title, subtitle, and any future textual metadata.
  • Prefer constructing the SVG with a structured XML API such as xml.etree.ElementTree, which serializes text nodes safely instead of relying on string interpolation.
  • Apply a conservative display-character policy to token symbols, allowing only characters required for legitimate symbols and replacing or rejecting control characters and XML syntax.
  • Keep validation and output encoding separate: validation reduces unexpected content, while context-appropriate XML escaping remains mandatory.
  • Add regression tests using symbols containing &, <, >, quotes, closing text tags, and SVG event-handler payloads. Verify that these values remain literal text in the generated document.
  • Where practical, serve or open generated SVGs with restrictive sandboxing and Content Security Policy. This is defense in depth and must not replace output encoding.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents and implies both network access and file-writing behavior but does not declare any tool scope or permissions boundaries. This can lead to overbroad execution in environments that rely on explicit declarations for review, sandboxing, or user consent, increasing the chance of unexpected outbound requests or file creation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says to use the skill when the user asks for "a chart, candles, price history or 'how did X move'". Phrases like "a chart" and "price history" are generic and could match many non-crypto contexts, while the description does not provide negative examples or tighter activation constraints.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The skill sends user-supplied token, chain, and timeframe parameters to an external API, which constitutes data exfiltration outside the host environment. While expected for a market-data skill, it is still security-relevant because user queries and selected assets may be sensitive, and the external dependency could log or profile requests.

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
- Solana candles are one pool's prices (the main pool), not a blend across pools.
- If the last candle is still open, `lastCandleOpen` is true and the subtitle says so.
- About 60 requests a minute without a key; a chart costs one or two requests.
- For raw data without a chart: `GET https://api.getchord.xyz/v1/candles?chain=<chainId>&token=<address>&tf=1h&limit=48` (EVM) or `GET https://api.getchord.xyz/v1/chains/solana/token/<mint>/candles?tf=1h&limit=48`.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/chart.py (reported line 21)May include surrounding context.

python
import urllib.parse
import urllib.request

API = "https://api.getchord.xyz/v1"
CHAINS = {"ethereum": 1, "monad": 143, "robinhood": 4663, "arc": 5042, "avalanche": 43114, "base": 8453, "bnb": 56, "arbitrum": 42161}
TFS = ("1m", "5m", "15m", "1h", "4h", "1d", "1w")
EVM_ADDR = re.compile(r"^0x[0-9a-fA-F]{40}$")