Back to skill

Security audit

Token Guard

Security checks for vulnerabilities and agentic risk

Overview

TokenGuard is a local quota-tracking helper whose file writes are purpose-aligned and do not store prompts or send data elsewhere.

Before installing, understand that this skill is a local quota helper: it may write a state.json file containing model usage counters, and it should be integrated deliberately before API calls rather than assumed to enforce provider limits automatically.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (2)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · scripts/token_guard.py (reported line 80)May include surrounding context.

python
return self._init_state()
                    return data
            except (json.JSONDecodeError, OSError):
                # Corruption detected, reset state
                return self._init_state()
        return self._init_state()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code estimates tokens from the provided prompt text and then writes usage state to a local JSON file via _save_state_atomic. Although the state currently stores counts rather than raw prompt content, the script accepts user prompt text as input and performs filesystem writes without any visible warning, confirmation, or user-facing disclosure in code comments/messages about creating and updating state.json.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.