Back to skill

Security audit

Tokensave Publish

Security checks for vulnerabilities and agentic risk

Overview

TokenSave is a disclosed local session cost analyzer with optional networked wrapper behavior, but users should be aware it reads session transcripts and is installed from an unpinned external Python package.

Install in an isolated Python environment, verify the `tokensave` package source and version before use, and only allow it to analyze specific sessions you intend to share with the tool. Treat pipeline mode separately because it can process API requests and requires an API key and network access.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:140
Finding

Unpinned Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 140
Vulnerability Type: Unpinned and unverified third-party dependency installation
Risk Level: Medium

Vulnerable Code Snippet:

markdown
## What You Need

- Python 3.10+
- `pip install tokensave`
- Analyze mode: nothing else — no API keys, no network, no config
- Pipeline mode (separate): requires `OPENAI_API_KEY` and makes API calls

Technical Analysis

The installation instruction uses pip install tokensave without specifying an audited version, cryptographic hash, trusted package index, or verifiable source revision. Consequently, the installed artifact is determined by the state of the configured Python package index at installation time.

This creates a supply-chain risk because a compromised package release, compromised package repository, dependency-confusion condition, or malicious index configuration could cause attacker-controlled content to be installed. Python package installation may execute package-controlled build or installation logic, and the installed CLI subsequently runs with the invoking user's privileges.

The project contains only SKILL.md; no implementation or dependency lock data is included. Therefore, the document's claims that analysis is local and does not make network calls cannot be independently verified against the installed package from the audited artifact alone. This audit does not establish that the current tokensave package is malicious; the issue is the unsafe, mutable installation mechanism.

Attack Path

  1. An attacker compromises the package, one of its transitive dependencies, the configured package index, or package-resolution infrastructure.
  2. The attacker publishes a malicious release that resolves under the unpinned tokensave requirement.
  3. A user follows the documented pip install tokensave instruction.
  4. pip retrieves the attacker-controlled package or dependency because ...[truncated 861 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the dependency to a specifically reviewed version, such as tokensave==<audited-version>.
  2. Distribute a requirements or lock file containing cryptographic hashes and install with pip install --require-hashes -r requirements.txt.
  3. Explicitly specify the trusted package index or verified source repository rather than relying on ambient pip configuration.
  4. Verify package provenance through signed releases, repository tags, and reproducible build artifacts where available.
  5. Pin and hash all transitive dependencies, not only the top-level package.
  6. Recommend installation in an isolated virtual environment under a non-privileged account.
  7. Include the audited implementation or a verifiable source revision in the skill package so claims concerning local processing and network behavior can be reviewed.
  8. Perform automated dependency and provenance checks before updating the documented version.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
70% confidence
Finding

Shadow Command Trigger: 'run tokensave' conflicts with built-in command 'run'

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest prominently claims the skill is a '100% local, zero config' analysis tool, but the document also advertises a separate pipeline/proxy mode that uses an API key and makes network calls. Even though the text says analyze mode is local, combining both capabilities in one skill creates a misleading trust boundary and increases the chance an agent or user treats the whole package as purely local when it is not.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Several triggers such as 'analyze cost', 'estimate cost', 'api fees', or 'where is my money going' are broad enough to match ordinary discussion rather than an explicit request to run a local analyzer against session artifacts. That can cause accidental invocation, which is particularly sensitive here because the skill is capable of reading local session data from ~/.hermes/state.db or session JSON files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

A transparent API wrapper/proxy is materially broader than a session-cost analyzer because it can sit in the path of future model traffic, transform requests, and affect data flows beyond local diagnostics. In skill ecosystems, that kind of hidden capability expansion is risky because users may invoke the skill for analysis but unknowingly adopt tooling that intercepts or modifies API usage.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.