Back to skill

Security audit

JSON验证工具

Security checks for vulnerabilities and agentic risk

Overview

This JSON validation skill is not proven malicious, but it asks for command execution and file-writing powers that are broader than its stated purpose explains.

Install only if you are comfortable granting this skill file read/write and command-execution capability to your agent. For normal JSON validation, prefer a narrower validator or require explicit confirmation before any command execution, file modification, or outbound API transmission.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:25
Finding

Overprivileged Tool Permissions for JSON Validation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 25–28
Vulnerability Type: Excessive filesystem and command-execution permissions
Risk Level: Medium

Vulnerable Code

yaml
tools:
- read
- exec
- write

The broader capabilities are also advertised at lines 220–223:

markdown
- **File processing**: Supports reading, parsing, and writing files
- **API integration**: Calls external services through standardized interfaces and processes responses
- **Command execution**: Executes system commands in a secure sandbox and collects results
- **Information retrieval**: Quickly searches and filters target data

Technical Analysis

The skill declares general-purpose read, write, and exec access even though its stated primary purpose is JSON syntax and structure validation. That task can ordinarily be implemented with a constrained JSON parser and does not require unrestricted command execution, file modification, external API access, or general information retrieval.

Although the document recommends command whitelisting and sandboxing, the reviewed package contains no implementation, command whitelist, permitted-path policy, endpoint allowlist, or enforceable sandbox configuration. The package consists solely of SKILL.md; no validator or other code is included. Consequently, the documented safeguards cannot be verified or enforced by package content.

This violates the principle of least privilege. If the hosting agent grants the declared tools based on the skill metadata, malicious or crafted input could potentially influence the agent into using those capabilities for actions outside JSON validation.

Attack Path

  1. A user or platform loads the skill and grants the declared read, write, and exec tools.
  2. An attacker supplies crafted content that is treated as instructions or otherwise influences the agent's tool-use decisions.
  3. The agent is induced to read l ...[truncated 1261 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove exec and write from the declared tools because they are unnecessary for in-memory JSON validation.
  2. Use a built-in, non-executing JSON parser with no shell invocation.
  3. If file input is necessary, permit read-only access only to a file explicitly selected by the user and constrain access to an approved workspace directory.
  4. If output-file creation is genuinely required, restrict writes to a dedicated output directory, reject traversal sequences, resolve canonical paths before access, and prevent overwriting existing or sensitive files.
  5. If command execution cannot be eliminated, define an exact executable and argument allowlist, prohibit shell interpretation, pass arguments as a structured array, impose time and resource limits, and run under a low-privilege sandbox.
  6. Define and enforce an endpoint allowlist before enabling API integration. Require explicit user approval before transmitting content and prevent secrets from being included.
  7. Add a concrete implementation and automated security tests so the documented path, command, input-size, and network restrictions can be verified.
  8. Remove unsupported capability claims and the absent assets/expanso-json-validate_template reference, or include and audit the required implementation assets.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is presented as a JSON validation utility, but its documented capabilities expand to file processing, API calls, command execution, and information retrieval. This mismatch violates least-privilege expectations and can mislead users or agents into granting powerful operations unrelated to the stated purpose, increasing the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

Advertising system command execution for a JSON validator is dangerous because command execution is a high-risk primitive that can be repurposed for arbitrary local actions, data access, or lateral movement. In this context, the skill description gives no legitimate need for shell access, so the capability materially increases risk without clear functional justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Early documentation frames the skill as a JSON validation tool, but later content broadens it into general automation behavior, including operations that can modify files or execute commands. This inconsistency is dangerous because users and orchestrators may trust the benign label while enabling a skill with much greater operational reach than expected.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

External API integration is broader than necessary for local JSON syntax/structure validation and may expose input data to third-party services or enable unintended outbound communication. While less inherently dangerous than shell execution, it still expands the attack surface and can create confidentiality, integrity, and supply-chain risks when the skill's core purpose does not clearly require it.

Content

No source excerpt is available for this finding.