Back to skill

Security audit

api-cost-tracker

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local API cost reporting tool with some disclosure gaps and report-output hardening issues, but no evidence of hidden exfiltration, persistence, or destructive behavior.

Install only if you are comfortable giving the tool local billing exports or usage logs. Prefer running it on files you trust, review Markdown reports before sharing them, and do not rely on the documented environment/API auto mode unless the publisher updates the implementation and explains exactly what credentials or account data it uses.

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/api_cost_tracker.py:362
Finding

Untrusted Model Names Permit Terminal and Markdown Report Injection

Content
View full analysis
8} {format_tokens(stats['input_tokens']):>8} " f"{format_tokens(stats['output_tokens']):>8} {format_cost(stats['cost']):>10}") print() # Top expensive requests if args.top: sorted_entries = sorted(entries, key=lambda e: e.cost or 0, reverse=True)[:args.top] print(f" Top {args.top} Most Expensive Requests:") print(f" {'─' * 56}") for i, e in enumerate(sorted_entries, 1): ts = e.timestamp.strftime("%m-%d %H:%M") if hasattr(e.timestamp, 'strftime') else str(e.timestamp)[:16] model = normalize_model_name(e.model)[:20] print(f" {i:>3}. {ts} {model:<20} {format_tokens(e.input_tokens):>6}in " f"{format_tokens(e.output_tokens):>6}out {format_cost(e.cost or 0)}") ``` The same untrusted aggregation key is inserted directly into Markdown output: ```python for key, stats in groups.items(): print(f"| {key} | {stats['count']} | {format_tokens(stats['input_tokens'])} | " f"{format_tokens(stats['output_tokens'])} | {format_cost(stats['cost'])} |") ``` ### Technical Analysis Model names are read from user-supplied JSON or CSV usage files. They are passed through `normalize_model_name()`, but that function only lowercases and trims the value, removes selected provider prefixes and date suffixes, and resolves known aliases. It does not reject or escape: - ANSI terminal escape sequences - Control characters - Newline and carriage-return characters - Terminal hyperlink sequences - Markdown table delimiters such as `|` - Markdown formatting or embedded HTML The resulting attacker-controlled values are printed directly to terminal and Markdown reports. Formatti ...[truncated 1741 chars]
Remediation
View remediation
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 (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises an 'auto' mode that reads from environment variables and references provider API keys, but it does not declare any explicit tool scope or permissions boundary. In an agent ecosystem, undocumented network/data-access capability increases the risk of the skill being invoked with broader access than the user expects, potentially exposing billing data or triggering outbound requests to provider APIs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad and include common cost-analysis language, which can cause the skill to activate in contexts the user did not intend. Because this skill may inspect files, usage logs, or environment-derived credentials, accidental activation increases the chance of unnecessary access to sensitive billing or API usage data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explicitly suggests analyzing from the environment via auto-detection of API keys, but it does not warn users that the skill may read API-key-bearing environment variables and sensitive usage/billing records. This is dangerous because users may invoke the skill without realizing it can access credentials and potentially retrieve or process private account and spending data.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.