Back to skill

Security audit

Token Tracker Pro

Security checks for vulnerabilities and agentic risk

Overview

This token-tracking skill mostly matches its stated purpose, but it also makes under-disclosed persistent system changes and exposes sensitive local usage history in ways users should review before installing.

Install only if you are comfortable with a local token-history file that may include session identifiers, and avoid running the shortcut setup or dashboard until the publisher removes autostart/.bashrc changes, binds the dashboard to localhost with authentication or field minimization, removes shell-based npx execution, pins or bundles browser dependencies, and fixes reset so it accurately deletes data or reports that it is not implemented.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (6)

T06 · System Persistence

Error
Location
shortcut.ts:44
Finding

Linux Shortcut Setup Creates Persistent Login Autostart Entries

Content
View full analysis
{ return new Promise((resolve) => { const configDir = path.join(process.env.HOME!, '.config', 'autostart'); if (!fs.existsSync(configDir)) { fs.mkdirSync(configDir, { recursive: true }); } const shortcutApps = { [SHORTCUTS.today]: 'token-tracker today', [SHORTCUTS.week]: 'token-tracker week', [SHORTCUTS.total]: 'token-tracker total', [SHORTCUTS.history]: 'token-tracker history', [SHORTCUTS.save]: 'token-tracker save', [SHORTCUTS.interactive]: 'token-tracker i' }; for (const [shortcut, command] of Object.entries(shortcutApps)) { const desktopFile = path.join(configDir, `token-tracker-${shortcut.replace('ctrl-', '')}.desktop`); const desktopContent = `[Desktop Entry] Type=Application Name=Token Tracker - ${shortcut} Exec=sh -c "token-tracker ${command}" Icon=terminal Terminal=true `; fs.writeFileSync(desktopFile, desktopContent); } const bashrcPath = path.join(process.env.HOME!, '.bashrc'); const bashrcContent = fs.readFileSync(bashrcPath, 'utf8'); if (!bashrcContent.includes('token-tracker-shortcuts')) { const newContent = bashrcContent + ` # Token Tracker Shortcuts export PATH="$HOME/.openclaw/skills/token-tracker/bin:$PATH" `; fs.writeFileSync(bashrcPath, newContent); } ``` ### Technical Analysis The feature is described as configuring keyboard shortcuts, but it writes multiple `.desktop` files to `~/.config/autostart`. Files in this directory are executed automatically when the user starts a graphical desktop session. This is persistence rather than shortcut registration and exceeds the permissions necessary to display token statistics. The generated command also resolves `token-tra ...[truncated 1360 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
dashboard.ts:72
Finding

Unauthenticated Network Exposure of Token History and Session Identifiers

Content
View full analysis
{ try { if (!existsSync(DATA_FILE)) { return res.json({ tokens: [], total: 0, daily: {}, weekly: {} }); } const data = JSON.parse(readFileSync(DATA_FILE, 'utf8')); const limit = parseInt(req.query.limit as string) || 50; res.json({ tokens: data.tokens.slice(-limit), total: data.total, daily: data.daily, weekly: data.weekly }); } catch (error: any) { console.error('Error:', error); res.json({ tokens: [], total: 0, daily: {}, weekly: {} }); } }); ``` ```ts app.listen(PORT, () => { console.log('\n🚀 Token Tracker Web Dashboard'); console.log(` 服务地址: http://localhost:${PORT}`); console.log(` 数据文件: ${DATA_FILE}`); console.log(` 按 Ctrl+C 停止服务\n`); }); ``` The records returned by this endpoint contain the following stored fields: ```ts let currentSession = { startTime: Date.now(), model: process.env.OPENCLAW_MODEL || 'unknown', sessionKey: process.env.SESSION_KEY || undefined }; ``` ### Technical Analysis The history API returns complete token records, including timestamps, model identifiers, token counts, and optional `sessionKey` values. No authentication or authorization is required. Calling `app.listen(PORT)` without a host does not enforce loopback-only access. Depending on the Node.js and operating-system network configuration, the service can listen on all available interfaces even though its console output and documentation describe it as a localhost dashboard. A local token dashboard only requires aggregated usage information. Returning raw session identifiers and exposing the endpoint beyo ...[truncated 912 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
bin/cli.js:10
Finding

Shell Command Injection Through CLI Arguments

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
dashboard.ts:121
Finding

Unpinned Third-Party Dashboard Script Has Access to Sensitive Same-Origin APIs

Content
View full analysis
``` The remotely loaded script executes in an origin that exposes history data: ```ts res.json({ tokens: data.tokens.slice(-limit), total: data.total, daily: data.daily, weekly: data.weekly }); ``` ### Technical Analysis The dashboard loads Chart.js directly from jsDelivr without an exact version, Subresource Integrity, or a restrictive Content Security Policy. The effective JavaScript payload can therefore change after the Skill has been reviewed. Third-party scripts execute with the privileges of the embedding page. In this case, the script can issue same-origin requests to `/api/history` and read the responses, including token records and session identifiers. It can then initiate outbound requests from the browser. The browser's same-origin policy does not protect against this scenario because the external script executes as part of the dashboard origin after it is loaded. ### Attack Path 1. The user opens the dashboard while connected to the network. 2. The browser downloads the unpinned `chart.js` resource from jsDelivr. 3. A compromised CDN response, compromised package release, or mutable dependency change supplies hostile JavaScript. 4. The hostile script runs with dashboard-origin privileges. 5. It requests `/api/history` and reads the returned token and session metadata. 6. It sends the collected data to an external destination or alters the dashboard. ### Impact Assessment Compromise of the remote script supply chain can expose every record available through the dashboard APIs and execute arbitrary browser-side behavior in the dashboard origin. The exposed scope includes timestamps, models, token usage, aggregate history, and session iden ...[truncated 89 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
public/index.html:295
Finding

Stored DOM Cross-Site Scripting in Token History Rendering

Content
View full analysis
` ${token.date} ${token.model} ${token.tokens.toLocaleString()} ${token.sessionKey.slice(-8)} `).join(''); // Update suggestions document.getElementById('suggestions-list').innerHTML = suggestions.map(suggestion => `
  • ${suggestion}
  • `).join(''); ``` ### Technical Analysis Persisted record values are interpolated into an HTML string and assigned to `innerHTML` without encoding. The `model` and `sessionKey` fields originate from environment-derived session metadata and are saved to the history file. If an attacker or untrusted integration can influence these values, HTML markup and event handlers can be stored and later executed when the dashboard renders the record. The code also calls `token.sessionKey.slice(-8)` even though `sessionKey` is optional in the TypeScript data model. A missing value can cause a runtime exception and prevent the remaining dashboard data from rendering. ### Attack Path 1. An attacker or untrusted integration controls `OPENCLAW_MODEL`, `SESSION_KEY`, or otherwise writes a crafted record to the history file. 2. The token-tracker hook stores the crafted value. 3. The dashboard requests the stored record from `/api/history`. 4. The browser interpolates the value into an HTML string. 5. Assignment to `innerHTML` parses the attacker-controlled markup. 6. The payload executes in the dashboard origin. 7. The payload can access same-origin history APIs and send data elsewhere. ### Impact Assessment Successful exploitation permits arbitrary JavaScript execution in the dashboard origin. The payloa ...[truncated 246 chars]
    Remediation
    View remediation

    T03 · Remote Payload Retrieval and Execution

    Warning
    Location
    bin/cli.js:13
    Finding

    CLI Can Retrieve and Execute a Package at Runtime Through npx

    Content
    View full analysis
    Remediation
    View remediation
    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 (72)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    94% confidence
    Finding

    The skill documentation presents a simple tracker, but the broader behavior includes file exports, model usage and cost analysis, dashboard access, reminders, cleanup, and reset operations. Combining data management, reporting, and serving capabilities under a narrow description increases the chance that users expose sensitive usage history or perform destructive actions without understanding the full scope.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    98% confidence
    Finding

    The skill documentation presents a simple tracker, but the broader behavior includes file exports, model usage and cost analysis, dashboard access, reminders, cleanup, and reset operations. Combining data management, reporting, and serving capabilities under a narrow description increases the chance that users expose sensitive usage history or perform destructive actions without understanding the full scope.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    98% confidence
    Finding

    The skill documentation presents a simple tracker, but the broader behavior includes file exports, model usage and cost analysis, dashboard access, reminders, cleanup, and reset operations. Combining data management, reporting, and serving capabilities under a narrow description increases the chance that users expose sensitive usage history or perform destructive actions without understanding the full scope.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    94% confidence
    Finding

    The skill documentation presents a simple tracker, but the broader behavior includes file exports, model usage and cost analysis, dashboard access, reminders, cleanup, and reset operations. Combining data management, reporting, and serving capabilities under a narrow description increases the chance that users expose sensitive usage history or perform destructive actions without understanding the full scope.

    Content

    No source excerpt is available for this finding.

    Known Vulnerable Dependency: path-to-regexp==8.3.0 — 2 advisory(ies): CVE-2026-4923 (path-to-regexp vulnerable to Regular Expression Denial of Service via multiple w); CVE-2026-4926 (path-to-regexp vulnerable to Denial of Service via sequential optional groups)

    High
    Category
    Supply Chain
    Confidence
    91% confidence
    Finding

    path-to-regexp 8.3.0 is transitively included via router/express and is flagged for ReDoS/DoS issues involving crafted route patterns or path processing. Because this skill depends on Express and may parse HTTP routes if it runs a local or remote service, denial-of-service against request handling is a plausible impact, making this more relevant than a purely dormant dev dependency.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    High
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    This code performs persistent system-level modification by creating autostart/shortcut artifacts and editing the user's shell profile, even though the skill's stated purpose is token tracking and analytics. That mismatch is dangerous because it expands the skill's privileges and persistence surface, making it easier to hijack future shells or normalize unexpected OS integration without informed consent.

    Content

    No source excerpt is available for this finding.

    Context-Inappropriate Capability

    High
    Category
    Not specified by scanner
    Confidence
    98% confidence
    Finding

    Appending to ~/.bashrc changes the user's shell environment persistently and affects future sessions beyond the current run. For a token tracking skill, this is unjustified and risky because it can alter command resolution via PATH, create a foothold for later code execution, and is done without validation, backup, or explicit consent.

    Content

    No source excerpt is available for this finding.

    Intent-Code Divergence

    High
    Category
    Not specified by scanner
    Confidence
    98% confidence
    Finding

    The reset command tells the user that all data has been reset, but it performs no deletion. This can create a dangerous false sense of data removal, causing users to leave sensitive token usage history on disk when they believe it has been erased.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    The entire quickstart is written in Chinese and does not indicate that the skill is Chinese-only, region-specific, or that other language options are available. Under the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy concern.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    The document title and all user-facing instructions are presented only in Chinese, with no indication that other languages are supported or that the language choice is optional. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    74% confidence
    Finding

    The skill advertises capabilities that imply environment access and a local web server/network exposure, but it does not declare any explicit tool scope or permissions boundary. In a skill ecosystem, this weakens reviewability and can cause users or orchestrators to grant broader access than expected, especially when the skill also references local file storage and dashboard hosting.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    The documentation exposes cleanup and reset commands without clearly warning that they may delete historical token data. Users may invoke destructive commands from copied examples or scripts and irreversibly lose audit/history information that could be useful for billing review or operational forensics.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    The file’s user-facing instructions, examples, and warnings are presented exclusively in Chinese, which effectively forces a specific language for users. Under the policy, this is a natural-language locale constraint unless the skill offers opt-in language choice or clearly documents a justified region-specific limitation, neither of which appears here.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    87% confidence
    Finding

    This markdown file presents all user-facing instructions and command descriptions exclusively in Chinese, and it does not indicate that the skill is region-specific or provide any opt-in language selection. Under the policy, forcing a specific language without user choice can be a natural-language policy violation.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    93% confidence
    Finding

    The update log documents substantial new capabilities for intelligent model recommendation, cost optimization, and scenario-based decision support that go beyond the declared skill purpose of merely tracking token consumption and providing usage statistics. This kind of scope drift is dangerous because users and downstream systems may grant the skill trust or permissions appropriate for a passive tracker while the actual feature set influences operational model selection and cost decisions without corresponding disclosure in the skill metadata.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    91% confidence
    Finding

    The wrapper invokes npx tsx without pinning a specific package version, which means execution may depend on whatever version npx resolves at runtime. That creates a supply-chain risk and makes behavior non-deterministic, especially for a local CLI whose stated purpose does not require fetching or trusting mutable external tooling on each invocation.

    Content

    No source excerpt is available for this finding.

    Static analysis

    Detected: suspicious.dangerous_exec, suspicious.env_credential_access

    Shell command execution detected (child_process).

    Critical
    Code
    suspicious.dangerous_exec
    Location
    bin/cli.js:15

    Shell command execution detected (child_process).

    Critical
    Code
    suspicious.dangerous_exec
    Location
    cli.js:20

    Environment variable access combined with network send.

    Critical
    Code
    suspicious.env_credential_access
    Location
    dashboard.ts:11