Back to skill

Security audit

JSON修复工具

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a JSON repair skill, but it asks for broader powers and makes inconsistent safety, API, and execution claims that users should review before installing.

Review this skill before installing. Use it only on trusted JSON files and only if you are comfortable granting file read/write and command execution for repair tasks. Do not provide API keys or callback URLs for this skill unless the publisher supplies a clear implementation and data-flow explanation. Prefer a JSON repair tool that uses a non-executing parser with explicit size, timeout, and file-scope limits.

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
SKILL.md:126
Finding

Unsafe Evaluation of Untrusted JSON-Like Input as JavaScript

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 126-154
Vulnerability Type: Unsafe dynamic JavaScript evaluation
Risk Level: Medium

Vulnerable Documentation Excerpt

The following excerpt is an English translation of the relevant instructions:

markdown
- **Eval sandbox**: Uses `vm.runInNewContext` for parsing, ensuring that the global scope and `process` cannot be accessed; it is safer than direct `eval`.

| `vm.runInNewContext` exception | Malicious code injection attempt | The sandbox has isolated it; verify whether the input file comes from a trusted source |

- Although `vm.runInNewContext` is safe, it should not process untrusted malicious files.

Technical Analysis

The skill directs the agent to repair malformed JSON by evaluating it as JavaScript through vm.runInNewContext. This permits JavaScript expressions rather than limiting input to passive JSON data.

A new VM context restricts direct access to the host global scope, but it does not make arbitrary JavaScript evaluation equivalent to safe JSON parsing. Crafted input can contain function calls, getters, computationally expensive expressions, memory-intensive operations, or nonterminating loops. These constructs may execute while the purported JSON document is parsed.

The documentation does not require a VM timeout, process-level memory limit, syntax allowlist, isolated worker process, or output-size restriction. It also acknowledges that malicious input may trigger VM exceptions and warns against processing untrusted files, confirming that hostile input is within the relevant threat model.

No JavaScript implementation is included in the audited package, so host escape or access to specific Node.js capabilities cannot be established. The confirmed weakness is the unsafe parsing design prescribed by the skill.

Attack Path

  1. An attacker provides a file represented as malformed JSON requiring repa ...[truncated 1034 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not evaluate JSON-like input as JavaScript. Use a non-executing parser designed for JSON5 or tolerant JSON repair.
  2. Pin the parser dependency to a reviewed version and maintain an appropriate lockfile.
  3. Configure the parser to accept only the explicitly supported extensions: trailing commas, single quotes, unquoted keys, comments, and hexadecimal or octal numbers.
  4. Reject functions, calls, getters, setters, prototype-related keys, regular expressions, template expressions, and other executable JavaScript constructs.
  5. Apply file-size, nesting-depth, token-count, processing-time, and output-size limits before parsing.
  6. If dynamic evaluation cannot immediately be removed, run it in a disposable worker process with a strict timeout, memory limit, empty context, no filesystem or network capabilities, and forced termination on limit violations. This should be treated only as a temporary mitigation.
  7. Update the documentation to avoid claiming that vm.runInNewContext makes untrusted JavaScript safe.
  8. Add negative tests using infinite loops, memory-exhaustion expressions, function calls, getters, and deeply nested input.
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 (8)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description says to use the skill whenever the user needs '提升效率、自动化流程、批量处理、工作流优化', which are broad, common intents rather than specific trigger phrases. Without tighter scope or exclusion examples, this could cause the skill to match many unrelated requests.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill introduces external API usage and API key configuration that are unrelated to local JSON repair. Unnecessary secret handling expands attack surface by encouraging users to expose credentials to a skill that should not need them, creating opportunities for credential misuse or exfiltration by an overprivileged agent workflow.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document inconsistently classifies the skill as both MD+EXEC and pure MD, while also describing command execution capabilities. This ambiguity is dangerous because agents or users may authorize file-system or shell actions under the mistaken belief that the skill is documentation-only, broadening the effective privilege of the skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill claims a specific safety property (vm.runInNewContext sandbox parsing) without providing any code or verifiable implementation, while elsewhere presenting itself as a Markdown-driven skill. This can mislead users and agents into trusting untrusted JSON/JavaScript-like input as safely sandboxed when no such guarantee is established, increasing the chance of unsafe execution assumptions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented capabilities expand beyond JSON repair to external service integration, command execution, and information retrieval, which are not justified by the stated purpose. In an agent context, this creates scope creep that can be exploited to trigger network access, shell execution, or broader data access under the trusted label of a simple utility skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

Display and descriptive text are presented in a mixed Chinese/English form, including imperative usage text, but the document does not state that the user can choose their preferred language. This may impose a locale/language assumption without explicit opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The request format explicitly advertises a callback_url for asynchronous completion, implying async job support. Later, the FAQ states that the tool does not support asynchronous processing and that all operations are synchronous. These statements directly contradict each other about the skill's intended behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The example tells users to '使用 JSON修复工具 处理以下任务: [具体任务描述]' but does not constrain what kinds of tasks are valid beyond a placeholder. This leaves activation scope ambiguous and does not provide negative examples or narrow task boundaries.

Content

No source excerpt is available for this finding.