Back to skill

Security audit

ohmytoken-tracker

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed token-usage tracker that sends limited usage metadata to ohmytoken.dev, with some privacy and configuration caveats users should understand.

Install only if you are comfortable sending model names and token counts for each LLM response to ohmytoken.dev. Keep the ohmytoken API key out of source control, prefer environment-variable or secret storage when available, and do not change the endpoint unless you trust the destination because the key is sent with each telemetry request.

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
src/index.ts:17
Finding

Unrestricted telemetry endpoint can expose the service API key and LLM usage metadata

Content
View full analysis

Vulnerability Details

File Location: src/index.ts, lines 17–40
Vulnerability Type: Unrestricted credential-bearing network destination
Risk Level: Medium

Vulnerable Code

typescript
const apiKey = config.api_key || process.env.OHMYTOKEN_API_KEY
const endpoint = config.endpoint || DEFAULT_ENDPOINT

if (!apiKey) {
  console.warn('[ohmytoken] No API key configured. Set OHMYTOKEN_API_KEY or config.api_key')
  return {}
}

return {
  name: 'ohmytoken-tracker',

  async onLLMResponse(usage: TokenUsage) {
    try {
      await fetch(endpoint, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-API-Key': apiKey,
        },
        body: JSON.stringify({
          model: usage.model || 'unknown',
          prompt_tokens: usage.prompt_tokens || 0,
          completion_tokens: usage.completion_tokens || 0,
          reasoning_tokens: usage.reasoning_tokens || 0,
          cached_tokens: usage.cached_tokens || 0,
        }),
      })

Technical Analysis

The Skill permits config.endpoint to specify an arbitrary network destination without validating its scheme or hostname. Every request to that destination includes the ohmytoken API key in the X-API-Key header, together with the model identifier and detailed token-usage telemetry.

An endpoint using plain HTTP exposes this information to network interception. An attacker-controlled HTTPS endpoint can directly collect the credential and telemetry. Arbitrary credential-bearing egress is broader than necessary for the declared hosted tracking functionality, whose documented service endpoint is https://api.ohmytoken.dev/api/v1/ingest.

The transmitted data does not include prompts, responses, files, provider API keys, or arbitrary conversation content based on the reviewed implementation. Its scope is limited to the ohmytoken API key, model name, and prompt, completion, r ...[truncated 1266 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the configurable endpoint if custom ingestion servers are not an essential supported feature.
  2. Otherwise, parse the configured value with URL and require the https: scheme.
  3. Restrict credential-bearing requests to an explicit hostname allowlist, preferably only api.ohmytoken.dev.
  4. Reject embedded credentials, unexpected ports, malformed URLs, and destinations outside the allowlist.
  5. Apply a restrictive redirect policy and ensure the API key is never forwarded to a different origin.
  6. Consider separating custom-endpoint support from hosted-service authentication so the ohmytoken API key is not sent to third-party collectors.
  7. Surface configuration and delivery errors safely instead of silently suppressing every failure, while ensuring logs never contain the API key.
  8. Update the privacy documentation to match the implementation: it currently describes four transmitted values including a timestamp, while the code sends five usage fields and no timestamp.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README instructs users to place an API key directly into a local configuration file but gives no guidance about keeping that credential secret, avoiding commits to source control, or using environment/secret management. This increases the likelihood of accidental credential exposure through repositories, logs, screenshots, or shared config files, which could allow unauthorized use of the associated account or tracking service.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest states that it 'automatically reports every LLM token consumed' to an external service, but it does not describe any triggering constraints, scoping limits, or user-controlled enablement. In a telemetry/observability skill, this creates a real privacy and governance risk because usage metadata is exported by default and may reveal model usage patterns, costs, or sensitive operational information without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description presents external reporting to ohmytoken.dev as the default behavior and does not mention any user choice, opt-in, or local-only mode. Even if intended for benign analytics, forced third-party transmission of usage telemetry is a legitimate security and privacy concern because it can violate least-privilege expectations and organizational policies on outbound data sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states it automatically reports model name and token usage to an external service, but it does not present a clear warning about background exfiltration of usage metadata or obtain explicit user consent. Even if only metadata is sent, this can disclose sensitive operational details such as model usage patterns, project activity, and potentially tenant/account associations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The configured endpoint sends data to an external domain, which creates a data egress path from the host environment to a third-party service. In the context of a background tracker that runs after each LLM response, this is security-relevant because users may not realize their usage metadata is being continuously transmitted off-platform.

Content

Scanner excerpt · instructions.md (reported line 29)May include surrounding context.

md
"enabled": true,
      "config": {
        "api_key": "omt_your_key_here",
        "endpoint": "https://api.ohmytoken.dev/api/v1/ingest"
      }
    }
  }

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The hardcoded external endpoint shows that the skill is designed to send data to a remote service outside the local trust boundary. In context this is not automatically malicious, but it does create a real exfiltration channel for usage metadata, especially because users may not expect network egress from a tracking skill and the destination can be overridden via configuration.

Content

Scanner excerpt · src/index.ts (reported line 14)May include surrounding context.

ts
cached_tokens?: number
}

const DEFAULT_ENDPOINT = 'https://api.ohmytoken.dev/api/v1/ingest'

export default function ohmytokenTracker(config: OhmyTokenConfig) {
  const apiKey = config.api_key || process.env.OHMYTOKEN_API_KEY

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill automatically transmits token-usage telemetry to a third-party endpoint whenever an LLM response is processed, but provides no user-facing disclosure, consent flow, or opt-in control. Even though the payload appears limited to usage metrics, it still exports operational metadata off-system and the silent failure behavior makes the transmission less visible to users and operators.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill does disclose that it sends model name, token counts, and timestamps to an external service, but it does not present this as a clear upfront warning before installation/configuration. Because usage telemetry is transmitted off-device and tied to an API key/account, users may not fully appreciate that their activity metadata is being shared with a third party, which creates privacy and profiling risk even if prompt contents are not sent.

Content

No source excerpt is available for this finding.