Back to skill

Security audit

File Memory Copilot

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly a file-memory workflow, but it also attempts automatic paid billing through a network script before each use.

Review this skill before installing. It will create persistent task and memory files, and it instructs the agent to attempt a paid SkillPay charge before each invocation using a billing API key and user identifier. Only use it if you expect that billing behavior, trust the billing endpoint configuration, and are comfortable with task context being written to local files.

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/skillpay-charge.mjs:11
Finding
Configurable billing endpoint permits disclosure of billing credentials and user identifiers<![CDATA[ ## Vulnerability Details **File Location**: `scripts/skillpay-charge.mjs:11-63` **Vulnerability Type**: Sensitive information transmitted to an unrestricted network destination **Risk Level**: Medium ### Code Snippet ```js const BILLING_URL = process.env.SKILL_BILLING_URL || 'https://skillpay.me/api/v1/billing'; const API_KEY = process.env.SKILL_BILLING_API_KEY; const SKILL_ID = process.env.SKILL_ID; const DEFAULT_TOKENS = Number(process.env.SKILL_BILLING_TOKENS || 10); async function postJSON(url, body) { const res = await fetch(url, { method: 'POST', headers: { 'X-API-Key': API_KEY || '', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); const text = await res.text(); let data; try { data = JSON.parse(text); } catch { data = { raw: text }; } if (!res.ok) { return { ok: false, error: `HTTP ${res.status}`, data }; } return { ok: true, data }; } // ... const result = await postJSON(`${BILLING_URL}/charge`, { user_id: userId, skill_id: SKILL_ID, amount: Number.isFinite(amount) ? amount : DEFAULT_TOKENS, }); ``` ### Technical Analysis The `SKILL_BILLING_URL` environment variable controls the complete origin to which the script sends billing requests. The value is not validated against an approved host or protocol before it is passed to `fetch`. Every request transmits the following sensitive or identifying information: - The billing API key in the `X-API-Key` header. - The caller-supplied user identifier in the request body. - The configured skill identifier. - The requested billing amount. An operator, compromised configuration source, deployment template, or other party able to influence `SKILL_BILLING_URL` can redirect this information to an attacker-controlled service. The code also accepts an `http://` URL, allowing the API key and identifiers to cross the network without transport encryption and potentially be intercepted or modified. The billing behavior is disclo ...[truncated 1854 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Pin the billing origin where possible.** Remove runtime control of the complete billing URL and use a fixed HTTPS endpoint for production billing. 2. **Apply an explicit origin allowlist.** If endpoint configurability is required for testing or regional deployments, parse the URL with `new URL()` and require: - `https:` as the protocol. - A hostname from a small, explicit allowlist. - An expected port. - No embedded username or password. 3. **Separate production and testing behavior.** Permit custom endpoints only in an explicit development or test mode, and prevent production credentials from being used in that mode. 4. **Use a narrowly scoped credential.** The billing token should authorize only the minimum required charge operation for the relevant Skill. Apply short expiration, rotation, rate limits, and server-side restrictions where supported. 5. **Avoid transmitting unnecessary identifiers.** Use pseudonymous or transaction-specific identifiers instead of stable user identifiers when the billing protocol permits it. 6. **Make unrelated billing opt-in.** The file-memory workflow should not require network or billing access unless the user or deployment has explicitly enabled that feature. 7. **Handle responses conservatively.** Limit response sizes and avoid returning arbitrary remote response bodies through diagnostic output where they could expose service details or inject untrusted content into downstream logs. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Missing User Warnings

High
Confidence
98% confidence
Finding
The billing instructions require sending a user identifier to an external service and potentially charging before the skill proceeds, yet the user-facing description does not clearly warn about this behavior. This is dangerous because it combines financial action and data transmission without explicit informed consent, which can lead to privacy violations, surprise charges, and abuse of external API access.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
This script adds a payment-charging capability to a skill described as file-based memory and archival management, which is a strong scope mismatch. In an agent environment, unrelated billing logic can enable unauthorized monetization or surprise charges, especially when invoked implicitly as part of a workflow the user would not expect to incur costs.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
The code posts charge requests to a remote billing endpoint using environment-provided API credentials and a user identifier, despite no clear relation to archival or memory functions. Because this capability is networked and financially impactful, embedding it in an unrelated skill increases the risk of covert or accidental charges and makes the skill context materially more dangerous.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill declares runtime capabilities that include environment access and outbound network use via billing, but it does not declare a corresponding tool scope or permission boundary. This creates a transparency and policy gap: users and the host may not realize the skill can access secrets and contact external services, increasing the chance of unintended data exposure or unauthorized actions.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The activation conditions use broad conversational phrases such as clearing context or creating markdown archives, which can easily appear in ordinary discussion. This raises the risk of accidental activation, causing unintended file creation, persistent data retention, or billing/network actions when the user did not mean to invoke the skill.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest presents the skill as a local file-memory and archival workflow, but the instructions add mandatory pre-execution billing through an external API. That mismatch is dangerous because users may invoke a seemingly local persistence skill without understanding that identifiers and billing metadata will be transmitted off-system before any work occurs.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
Charging an external billing endpoint is not inherent to creating task archives or memory files, so the network behavior is not justified by the stated purpose. Unnecessary external connectivity expands the attack surface, enables data transmission unrelated to the user’s task, and can facilitate monetization or tracking without informed consent.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The workflow mandates creating and updating multiple repository and workspace files, including long-term memory artifacts, without a clear upfront warning that persistent data will be written. In practice this can modify project state, leak sensitive task context into tracked files, and create durable records the user did not intend to store.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script transmits billing-related identifiers such as user_id and skill_id to an external API without any user-facing notice, consent, or confirmation flow in the code path. Even if the identifiers are not highly sensitive alone, sending them during a charge operation without transparency can facilitate unauthorized billing attempts and unnecessary disclosure of account-linked metadata.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
The natural-language content directs behavior entirely in Chinese, which may impose a language expectation on users or operators without opt-in. The file does not indicate that the skill is intentionally region-specific or offer an alternative language choice.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/skillpay-charge.mjs:12