Back to skill

Security audit

Token Usage Tracker

Security checks across malware telemetry and agentic risk

Overview

This token tracker is mostly purpose-aligned, but it automatically runs on broad hooks and reuses a stored DeepSeek API key for balance checks, so users should review it before installing.

Install only if you use WorkBuddy on Windows and want automatic per-response token, cost, and balance notifications. Before enabling the hooks, understand that the script may run every prompt/response, contact OpenRouter for pricing, update local pricing files, read a DeepSeek API key from models.json, call DeepSeek's balance endpoint, and store balance history values locally. Avoid installing it in environments where stored API keys or outbound network calls from skills are not acceptable.

SkillSpector

By NVIDIA
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (22)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill declares a narrow local-trace purpose but documents capabilities requiring network access and environment/file interaction without explicit permission disclosure. Hidden capability expansion is dangerous because it weakens user consent and makes downstream execution environments unable to enforce least privilege.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior substantially exceeds the stated purpose of merely reading local trace files and appending token statistics. It also performs network requests, mutates local pricing data, queries account balance using an API key, and emits system notifications, which creates a material transparency and consent failure.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The documentation says the skill is a local token tracker, but later sections add external pricing/balance lookups and writes to pricing state. This discrepancy is dangerous because users may authorize the skill under a false assumption that no remote data flow or extra state changes occur.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
Reading local model configuration to obtain a DeepSeek API key and using it to query account balance goes beyond token tracking and touches sensitive credentials. Even if the key is only used locally, accessing and transmitting credential-authorized account data without prominent consent raises clear security and privacy risks.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
Automatic online discovery of unknown model pricing and persistent modification of pricing.json exceeds the justified scope of displaying trace-derived usage. This broadens the attack surface through unexpected network activity and local state mutation, especially when triggered implicitly.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The document claims the skill does not modify platform files and only reads traces plus its snapshot, yet elsewhere it describes writing pricing, balance, and probe files. Contradictory claims about side effects are dangerous because they undermine informed consent and make auditing harder.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The file states that the skill will automatically refresh pricing data from external APIs once per day, which expands behavior beyond the declared local trace-reading purpose. That creates an undeclared network-capable data flow, increasing privacy, supply-chain, and integrity risk because remote content can influence local behavior or outputs without explicit user consent.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
Displaying token usage and elapsed time for a local client trace does not inherently require contacting OpenRouter, LiteLLM, Portkey, or vendor pricing endpoints. Adding automatic external access broadens the attack surface unnecessarily and may leak usage metadata or enable remote content to affect local calculations and UI messaging.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
This helper script performs network retrieval and rewrites a local pricing.json file, which materially expands the skill's behavior beyond the stated purpose of reading local WorkBuddy trace files and displaying token usage. That mismatch is security-relevant because it introduces an unexpected external dependency and local file modification path that users and reviewers may not anticipate, increasing supply-chain and integrity risk if remote data is wrong, manipulated, or the script is invoked automatically.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The network call to OpenRouter is not necessary for the core described function of showing token counts from local trace files, so it adds unnecessary attack surface and data-flow complexity. Even though the endpoint is read-only and no secret is sent, unexpected outbound connectivity can create privacy, availability, and trust issues, especially in restricted or offline environments where users expect purely local behavior.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The skill’s stated purpose is local trace-based token/time display, but this section adds automatic price refresh behavior by launching another script and updating local pricing state. That expands the trust boundary from offline local parsing to network-backed data mutation, which is unnecessary for the core feature and can surprise users or create integrity and availability risks if remote pricing data is wrong or the helper script is compromised.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
This code reads stored API credentials from local configuration and uses them to call DeepSeek’s balance endpoint, despite the skill being described as a trace-file token tracker. That is a materially different capability involving credential access and external transmission, and it can expose sensitive account metadata or normalize unauthorized reuse of API keys without clear user consent.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The skill spawns PowerShell to display Windows toast notifications, which exceeds the advertised behavior of appending text to replies. Invoking a shell/interpreter increases attack surface and grants the skill an OS-level execution capability that could be repurposed or abused, even if the current command content is intended only for notifications.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
This section parses models.json specifically to extract API keys for DeepSeek, which is unrelated to merely reading local trace files. Accessing stored credentials broadens the skill’s privilege scope and creates a direct path for secret misuse or unintended disclosure if the code is altered, logged, or combined with other network features.

Vague Triggers

Medium
Confidence
77% confidence
Finding
Configuring the skill to act by default on every final reply creates an overbroad activation surface for a tool that may perform file reads, state writes, and optional network activity. Automatic invocation makes accidental execution more likely and reduces meaningful user control.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill instructs automatic network lookups and local file modification without surfacing that behavior prominently in the top-level activation summary. Users may enable it expecting a passive local tracker, while it actually reaches out to third-party services and changes local state.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill accesses a locally stored API key and performs external balance queries, but this credential use is not prominently disclosed at the top level. Hidden credential-backed requests are dangerous because they can surprise users, expose account metadata, and normalize unauthorized secret usage by skills.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The code silently reads API credentials from local configuration and sends them to DeepSeek for balance checks, but the advertised skill behavior emphasizes local trace inspection. Even though the destination is the vendor’s own API, undisclosed credential reuse and network transmission violate user expectations and can expose billing/account information without informed consent.

Missing User Warnings

Low
Confidence
90% confidence
Finding
This section automatically contacts OpenRouter to look up pricing for unrecognized models, which is not necessary for showing token counts and runtime from local traces. The risk is lower than secret exfiltration, but it still introduces undisclosed network behavior and remote influence over local file contents.

External Transmission

Medium
Category
Data Exfiltration
Content
- toast 为两行:行1 `模型名 | 时段标注 | 耗时[ 空格]余额¥X(半角 | 两侧各 1 空格)`,行2 `输入 X / 输出 Y|缓存NN.NN%|¥费用`(详见方式 C)。

## 余额显示(v2.8 新增,v2.10 改为"默认隐藏 + 变化检测",仅自定义 API 的 DeepSeek 官方模型)
- **原理(NIX 客户端同款)**:DeepSeek 官方接口 `GET https://api.deepseek.com/user/balance` + `Authorization: Bearer <API key>` 即可查询账户余额,**无需网页登录**——这就是 NIX 等 DeepSeek 客户端"只给 API key 就能显示余额"的原因。
- **启用条件**:仅当 `~/.workbuddy/models.json` 里存在 url 指向 `api.deepseek.com` 的模型(即用户自己的 DeepSeek API key)时启用;无 key → 不显示余额,不影响其他功能。
- **模式识别(v2.10,用户定调"默认不显示、抓到变化才显示")**:积分模式与自定义 API 模式无法从本地数据区分——官方文档证实内置模型列表就有 `Deepseek-V4-Flash`(与自定义 id 同名);trace/hook payload/transcript 无模式标记;进程级探测(tasklist/wmic/netstat)被本机安全策略禁用。"密钥是否在用"信号抓不到,但 **余额变化 = 账户在真实消耗** 是其等价信号(有密钥才有消耗)。判定规则:每次查询与上次观测对比(`toFixed(2)` 字符串比较避免浮点陷阱)——
  - **余额变了**(降=消费 / 升=充值)→ 显示 `余额¥X`(自定义 API 模式,或其他处用同一 key,显示的是真实余额);
Confidence
96% confidence
Finding
https://api.deepseek.com/

External Transmission

Medium
Category
Data Exfiltration
Content
}

// ===== DeepSeek 账户余额查询(NIX 客户端同款原理,仅自定义 API 模式) =====
// 原理:DeepSeek 官方接口 GET https://api.deepseek.com/user/balance + Bearer 认证即可查余额,
// 无需网页登录——这就是 NIX 等 DeepSeek 客户端"只给 API key 就能显示余额"的原因。
// 仅当 models.json 里配置了 DeepSeek 官方模型(url 指向 api.deepseek.com)时启用;内置积分模式无 key → 返回空。
Confidence
98% confidence
Finding
https://api.deepseek.com/

External Transmission

Medium
Category
Data Exfiltration
Content
const script = [
    '(async () => {',
    '  try {',
    `    const res = await fetch('https://api.deepseek.com/user/balance', { headers: { 'Accept': 'application/json', 'Authorization': 'Bearer ' + ${JSON.stringify(key)} } });`,
    '    if (!res.ok) { console.error(\'HTTP \' + res.status); process.exit(2); }',
    '    const j = await res.json();',
    '    const arr = (j && Array.isArray(j.balance_infos)) ? j.balance_infos : [];',
Confidence
99% confidence
Finding
https://api.deepseek.com/

VirusTotal

VirusTotal findings are pending for this skill version.

View on VirusTotal

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
token-tracker.js:334

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
token-tracker.js:28