Back to skill

Security audit

Api Cost Tracker

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent API cost-reporting skill, but users should be careful with sensitive billing exports and any future API-key based use.

Install only if you are comfortable analyzing AI billing or usage exports. Prefer user-provided export files, avoid processing files from untrusted sources, and use JSON output for machine-readable reports. Do not allow environment/API-key based provider access unless you explicitly intend it and understand which account data will be queried.

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:357
Finding

Unescaped Attacker-Controlled Model Names Enable Terminal and Markdown Output Injection

Content
View full analysis
8} {format_tokens(stats['input_tokens']):>8} " f"{format_tokens(stats['output_tokens']):>8} {format_cost(stats['cost']):>10}") ``` ```python 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)}") ``` ```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 and aggregation keys originate from user-supplied JSON or CSV usage files. The parsers retain these strings, and the terminal and Markdown output functions interpolate them directly into reports without context-specific encoding or validation. For terminal output, an attacker can include control characters such as carriage returns, newlines, ANSI control sequences, or OSC sequences in a model name. These characters can alter terminal presentation, overwrite report content, forge additional rows, hide warnings, or create deceptive hyperlinks. Some OSC effects, such as clipboard manipulation, depend on the victim's terminal emulator and its configuration. The 20-character truncation applied to one terminal output path does not provide effective protection because short escape sequences can still fit within that limit. O ...[truncated 2046 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
87% confidence
Finding

The skill advertises behavior that can access provider data from APIs or environment-derived credentials, but the manifest does not declare any explicit tool scope or permission boundaries. This makes the skill's operational reach ambiguous and can lead to unintended network access or secret-backed data retrieval when invoked in a broader agent environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest uses very broad trigger phrases like general cost-analysis and spending questions, which can cause the skill to activate in situations beyond narrowly intended API-cost auditing. Over-broad invocation increases the chance that sensitive billing files, logs, or credentials are processed when the user did not specifically intend this skill or its data access patterns.

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 instructs users to analyze data 'from environment' and auto-detect providers from API keys, but it provides no warning that this may access sensitive credentials or account-linked usage data. In an agent setting, normalizing environment-based access without consent can cause unintended secret use and retrieval of private billing information across multiple providers.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.