Back to skill

Security audit

Citrea Claw Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real Citrea monitoring tool, but it needs review because it directs agents to run shell commands with user-provided arguments and stores Telegram credentials in plaintext.

Install only if you are comfortable with an agent running local Node commands, using Citrea RPC, and optionally sending alerts through Telegram. Review or pin the source before any git clone/npm install step, avoid pasting bot tokens into chat when possible, store secrets with restrictive permissions, and validate or quote all user-provided command arguments before execution.

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

Error
Location
SKILL.md:86
Finding
Shell Command Injection Through Unquoted User-Controlled Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 86–92 **Vulnerability Type**: Shell command injection caused by unsafe argument interpolation **Risk Level**: High ### Vulnerable Code ```markdown **Triggers:** "check arb for [tokenA] and [tokenB]", "is there arb between [tokenA] and [tokenB]" ```bash cd ~/.openclaw/skills/citrea-claw-skill && node index.js arb:check <tokenA> <tokenB> ``` Example: user says "check arb for wcBTC and USDC" → run: ```bash cd ~/.openclaw/skills/citrea-claw-skill && node index.js arb:check wcBTC USDC.e ``` ``` The same unsafe construction pattern appears in other command templates, including `price`, `pool:price`, `pool:liquidity`, `balance`, and `txns`. ### Technical Analysis The Skill instructs the agent to build shell command strings by inserting token symbols, addresses, or other values derived from user messages. These arguments are not quoted or validated before being placed into commands executed through the `exec` tool. Although the JavaScript command handlers perform some validation, that validation occurs only after the shell has parsed the command line. Shell metacharacters such as command separators, substitutions, pipes, or redirections can therefore be interpreted before `index.js` receives its arguments. The issue exceeds the minimum privileges required by the declared functionality. Reading public Citrea data requires only launching Node.js with fixed command names and validated data arguments; it does not require passing user-controlled text through a command shell. ### Attack Path 1. A user invokes a supported Skill trigger and supplies a malicious token or address argument containing shell syntax. 2. The agent follows `SKILL.md` and interpolates that value into the documented command string. 3. The `exec` tool invokes the command through a shell. 4. The shell interprets the injected syntax independently of the intended `node index.js` command. 5. The injected command runs with the ...[truncated 752 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct a shell command by concatenating user-controlled text. 2. Use a process-execution API that accepts an executable and argument array without invoking a shell, for example: ```js spawn('node', ['index.js', 'arb:check', tokenA, tokenB], { shell: false, stdio: 'inherit' }) ``` 3. Strictly allowlist token arguments against the supported token registry before execution. 4. Validate addresses with a complete hexadecimal-address pattern: ```regex ^0x[0-9a-fA-F]{40}$ ``` 5. Validate numeric arguments using explicit minimum and maximum bounds. 6. If the OpenClaw execution interface only supports command strings, apply robust shell quoting to every argument after validation. Validation must occur before constructing the command. 7. Update `SKILL.md` to explicitly prohibit direct interpolation of raw user text into shell commands. 8. Run the Skill under a dedicated, minimally privileged account with no access to unrelated files or credentials. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:33
Finding
Telegram Bot Token Collected Through Chat and Stored in a Plaintext Environment File<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 33–39 **Vulnerability Type**: Insecure credential collection and plaintext secret storage **Risk Level**: Medium ### Vulnerable Code ```markdown Then ask the user the following questions one at a time and write their answers into `.env`: 1. **Telegram Bot Token** — "Do you have a Telegram bot token? If not, open Telegram, search @BotFather, send /newbot and follow the prompts. Paste your token here, or say skip to set up later:" → write to `TELEGRAM_BOT_TOKEN` 2. **Telegram Chat ID** — "What is your Telegram chat ID? Open Telegram, search @userinfobot, send /start and it will reply instantly with your ID:" → write to `TELEGRAM_CHAT_ID` ``` The configuration-update instruction at line 55 also directs the agent to modify the plaintext file: ```markdown If the user asks to change any setting — for example "change my arb threshold", "update my Telegram token", "change scan interval" — update the relevant line in `~/.openclaw/skills/citrea-claw-skill/.env` and confirm the change. ``` ### Technical Analysis The setup workflow asks users to disclose a Telegram bot token directly in an agent conversation. The token may consequently be retained in chat history, gateway logs, model-provider records, tracing systems, or other operational telemetry. The agent is then instructed to write the token to `~/.openclaw/skills/citrea-claw-skill/.env`. Neither `SKILL.md` nor the setup workflow requires restrictive permissions such as mode `0600`, atomic file creation, a dedicated secret store, or redaction when confirming configuration changes. A Telegram bot token is an authentication credential. Possession of it allows access to Telegram Bot API operations authorized for that bot. Collecting it through conversational text and storing it without documented access controls introduces avoidable exposure beyond what is necessary for the monitoring functionality. ### Attack Path 1. The Skill ask ...[truncated 1099 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not ask users to paste bot tokens into an agent conversation. 2. Instruct users to configure the credential directly through a local terminal, secret-management interface, or OpenClaw's protected environment configuration. 3. Prefer an operating-system or platform secret manager over a project-local `.env` file. 4. If `.env` storage remains supported: - Create the file with mode `0600`. - Verify ownership before reading or modifying it. - Use atomic replacement when updating values. - Prevent symbolic-link following. - Keep it excluded from source control, backups, diagnostics, and support bundles where possible. 5. Never include the credential value in confirmations, errors, debug output, or command history. 6. Document token rotation procedures and advise immediate rotation if the token has been pasted into a retained conversation. 7. Separate non-sensitive settings from secrets so ordinary configuration updates do not require rewriting the credential file. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
src/lib/telegram.js:11
Finding
Telegram Bot Credential Embedded in the HTTP Request URL<![CDATA[ ## Vulnerability Details **File Location**: `src/lib/telegram.js`, line 11 **Vulnerability Type**: Credential exposure through URL-based authentication **Risk Level**: Low ### Vulnerable Code ```js const res = await fetch(`https://api.telegram.org/bot${token}/sendMessage`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ chat_id: chatId, text: message, parse_mode: 'HTML', }), }) ``` ### Technical Analysis The Telegram bot token is included directly in the request URL. This format is required by the Telegram Bot API, but it creates an operational exposure because HTTP clients, outbound proxies, observability agents, exception trackers, or access-log systems may record complete request URLs. The code does not intentionally print the URL or token, and HTTPS protects it in transit against ordinary network observers. The primary risk is therefore disclosure through endpoint logging or tracing rather than cleartext network transmission. The request body contains the configured chat ID and the intended arbitrage or pool alert. The audit found no transmission of private keys, host files, arbitrary environment variables, or wallet secrets. ### Attack Path 1. An arbitrage or pool monitor calls `sendTelegram`. 2. The function creates a URL containing the full bot token. 3. An HTTP tracing layer, proxy, diagnostic facility, or infrastructure access log records the complete request target. 4. A party with access to that telemetry retrieves the token. 5. The party authenticates to the Telegram Bot API using the exposed credential. ### Impact Assessment An exposed token can allow unauthorized API calls as the Telegram bot, including forged alert messages and other actions supported by the Bot API. The direct privilege scope is the affected Telegram bot. This finding does not grant access to blockchain wallets, private keys, or Citrea accounts because the project performs only public, ...[truncated 31 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat the complete Telegram request URL as sensitive data. 2. Configure HTTP clients, outbound proxies, APM systems, and tracing infrastructure to redact path segments following `/bot`. 3. Disable full request-target logging for `api.telegram.org` where possible. 4. Ensure exception handling never serializes request objects or URLs containing the token. 5. Restrict access to network telemetry and apply short retention periods. 6. Use a dedicated bot with only the access required for alerts. 7. Rotate the token if existing logs or traces may have captured complete request URLs. 8. Consider isolating Telegram delivery in a narrowly scoped service so the main agent process does not need direct access to the bot credential. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (47)

YARA rule 'agent_skill_credential_exfiltration_webhook': AI agent skill credential harvesting followed by webhook or external exfiltration [agent_skills]

Critical
Category
YARA Match
Content
export async function sendTelegram(message) {
  const token  = process.env.TELEGRAM_BOT_TOKEN
  const chatId = process.env.TELEGRAM_CHAT_ID

  if (!token || !chatId) {
    console.warn('⚠️  Telegram not configured — set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in .env')
    return
  }

  try {
    const res = await fetch(`https://api.telegram.org/bot${token}/sendMessage`, {
      method:  'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        chat_id:    chatId,
        text:       message,
        parse_mode: 'HTML',
      }),
    })

    if (!res.ok) {
      const err = await res.text()
      console.err
Confidence
85% confidence
Finding
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Credential Access

High
Category
Privilege Escalation
Content
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
# edit .env with your Telegram bot token and chat ID
```

Restart your OpenClaw gateway and start a new session with your agent. Then ask:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
# edit .env with your Telegram bot token and chat ID
```

Restart your OpenClaw gateway and start a new session with your agent. Then ask:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
# edit .env with your Telegram bot token and chat ID
```

Restart your OpenClaw gateway and start a new session with your agent. Then ask:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
git clone https://github.com/jason-chew/citrea-claw-skill.git ~/.openclaw/skills/citrea-claw-skill
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
```

> **Important:** The repo must be cloned into `~/.openclaw/skills/citrea-claw-skill/` for your OpenClaw agent to find and execute commands. Cloning anywhere else will result in the skill not working.
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
git clone https://github.com/jason-chew/citrea-claw-skill.git ~/.openclaw/skills/citrea-claw-skill
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
```

> **Important:** The repo must be cloned into `~/.openclaw/skills/citrea-claw-skill/` for your OpenClaw agent to find and execute commands. Cloning anywhere else will result in the skill not working.
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
git clone https://github.com/jason-chew/citrea-claw-skill.git ~/.openclaw/skills/citrea-claw-skill
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
```

> **Important:** The repo must be cloned into `~/.openclaw/skills/citrea-claw-skill/` for your OpenClaw agent to find and execute commands. Cloning anywhere else will result in the skill not working.
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
git clone https://github.com/jason-chew/citrea-claw-skill.git ~/.openclaw/skills/citrea-claw-skill
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
```

> **Important:** The repo must be cloned into `~/.openclaw/skills/citrea-claw-skill/` for your OpenClaw agent to find and execute commands. Cloning anywhere else will result in the skill not working.
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
A Telegram connectivity test and alerting workflow are not the same as Citrea monitoring, yet they are embedded in the same skill instructions. This broadens the skill's effective scope into external communications and secret handling, which is especially risky when the stated purpose does not prepare reviewers for that behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
A Telegram connectivity test and alerting workflow are not the same as Citrea monitoring, yet they are embedded in the same skill instructions. This broadens the skill's effective scope into external communications and secret handling, which is especially risky when the stated purpose does not prepare reviewers for that behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
A Telegram connectivity test and alerting workflow are not the same as Citrea monitoring, yet they are embedded in the same skill instructions. This broadens the skill's effective scope into external communications and secret handling, which is especially risky when the stated purpose does not prepare reviewers for that behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A Telegram connectivity test and alerting workflow are not the same as Citrea monitoring, yet they are embedded in the same skill instructions. This broadens the skill's effective scope into external communications and secret handling, which is especially risky when the stated purpose does not prepare reviewers for that behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
A Telegram connectivity test and alerting workflow are not the same as Citrea monitoring, yet they are embedded in the same skill instructions. This broadens the skill's effective scope into external communications and secret handling, which is especially risky when the stated purpose does not prepare reviewers for that behavior.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
The skill authorizes cloning code from GitHub and running npm install, which introduces direct supply-chain risk and arbitrary code execution potential. In an agent setting, this is particularly dangerous because dependency installation may run lifecycle scripts and pull in unreviewed packages without strong user scrutiny.

Credential Access

High
Category
Privilege Escalation
Content
git clone https://github.com/jason-chew/citrea-claw-skill.git ~/.openclaw/skills/citrea-claw-skill
cd ~/.openclaw/skills/citrea-claw-skill
npm install
cp .env.example .env
```

Then ask the user the following questions one at a time and write their answers into `.env`:
Confidence
89% confidence
Finding
The setup flow explicitly creates a .env file and then instructs the agent to populate it with credentials, which constitutes credential collection and local storage. Even if intended for configuration, this is dangerous because it normalizes acquiring reusable secrets through the skill and storing them in a location other tools or users may access.

Known Vulnerable Dependency: ws==8.18.3 — 2 advisory(ies): CVE-2026-45736 (ws: Uninitialized memory disclosure); CVE-2026-48779 (ws: Memory exhaustion DoS from tiny fragments and data chunks)

High
Category
Supply Chain
Confidence
98% confidence
Finding
The lockfile pins transitive dependency ws to version 8.18.3, and the supplied advisories indicate that this version is affected by an uninitialized memory disclosure flaw and a memory-exhaustion denial-of-service issue. Because this skill performs blockchain monitoring and may use websocket-based RPC/event connections through viem, an exploitable ws issue is relevant in context and could expose process memory or let a remote endpoint degrade or crash the agent.

Credential Access

High
Category
Privilege Escalation
Content
const chatId = process.env.TELEGRAM_CHAT_ID

  if (!token || !chatId) {
    console.warn('⚠️  Telegram not configured — set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in .env')
    return
  }
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The README encourages broad natural-language invocations such as asking the agent to check balances, recent transactions, or arbitrage without defining explicit activation boundaries, parameter validation, or confirmation requirements. In an agent-integrated skill, this can cause unintended command execution or sensitive lookups when user prompts are ambiguous, overbroad, or influenced by prompt injection in surrounding context.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README advertises Telegram alerts but does not clearly warn that monitored data, addresses, pool activity, and potentially strategy-relevant signals will be transmitted to a third-party service. This creates a privacy and operational security risk because users may unknowingly exfiltrate trading intelligence or wallet-related metadata outside their local environment.

Session Persistence

Medium
Category
Rogue Agent
Content
npm install
```

**2. Create your `.env` on the server**
```bash
nano .env
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill invokes external commands, uses environment variables, and is designed to access network resources, but it declares no explicit tool scope or allowed-tools restrictions. In an agent environment, that weakens containment and can let the skill exercise more capability than users or platform policy expect.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The visible description omits Telegram alerting and configuration despite those being central behaviors elsewhere in the file. Omitting such capabilities undermines informed consent and prevents accurate risk assessment of secret collection and outbound messaging.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The documentation expands from using an installed monitoring skill into cloning software, installing dependencies, and editing configuration files. That increases supply-chain and persistence risk because an agent may fetch and execute unreviewed code or modify the local environment under the authority of a much narrower-seeming skill.

Session Persistence

Medium
Category
Rogue Agent
Content
cp .env.example .env
```

Then ask the user the following questions one at a time and write their answers into `.env`:

1. **Telegram Bot Token** — "Do you have a Telegram bot token? If not, open Telegram, search @BotFather, send /newbot and follow the prompts. Paste your token here, or say skip to set up later:"
   → write to `TELEGRAM_BOT_TOKEN`
Confidence
90% confidence
Finding
The instruction to write user-provided values into .env establishes durable session persistence for sensitive configuration beyond the immediate interaction. Persistent storage increases the blast radius of a compromise and may keep secrets available long after the user expected the session to end.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill instructs the agent to collect Telegram credentials and persist them locally even though simple command execution does not require that for every use case. Collecting secrets conversationally and storing them on disk expands the attack surface and increases the chance of accidental disclosure or misuse.

Static analysis

No suspicious patterns detected.