Back to skill

Security audit

JSON格式化工具

Security checks for vulnerabilities and agentic risk

Overview

The skill is mainly a JSON formatter, but it asks for broad command and file-writing authority and describes API-key, network, and command-execution features that are not well scoped for that purpose.

Review this before installing in any agent that grants shell execution, filesystem writes, or network access. It should be limited to explicit JSON formatting tasks, preferably with exec disabled and writes constrained to user-selected files.

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

Excessive command-execution and filesystem-write permissions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 25–28; corroborating functionality at lines 327–331
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: Medium

Vulnerable Code

yaml
tools:
- read
- exec
- write

The broad permissions are reinforced by the following declarations at lines 327–331:

markdown
## 功能介绍
- **自动化执行**: 格式化/校验/压缩JSON并提取路径,提升可读性。Format, validate, compress JSON dat
- **文件处理**: 支持多种文件格式的读取、解析和写入操作
- **API集成**: 通过标准化接口调用外部服务并处理响应
- **命令执行**: 在安全沙箱中执行系统命令并收集结果

Technical Analysis

The Skill declares unrestricted exec and write capabilities despite its stated purpose being to format, validate, compress, and inspect JSON. Those operations can normally be performed in memory and do not inherently require arbitrary system-command execution or unrestricted filesystem modification.

No command allowlist, destination-path restriction, domain restriction, or mandatory user-confirmation boundary is defined. If the hosting Agent grants the declared tools, the Skill therefore receives capabilities beyond the minimum privileges required for its core functionality.

The document also presents generic command execution and external API integration as supported features. This broadens the operational scope without defining how commands, arguments, files, or destinations are validated. The audit did not find an explicit instruction that directly interpolates untrusted JSON into a shell command, so exploitation depends on the hosting Agent being induced to exercise these overly broad tools.

The command at line 221:

bash
curl -s https://api.example.com/data | python -m json.tool

does not constitute remote payload execution: downloaded data is passed to Python's standard JSON parser rather than to a shell. It nevertheless demonstrates optional network access that is unnecessary for processing JSON supplied directl ...[truncated 1731 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove exec and write from the declared tools for ordinary in-memory JSON formatting, validation, compression, statistics, and path extraction.
  2. Retain only the minimum input-reading capability needed by the hosting platform.
  3. If file output is an essential optional feature, require an explicit user-selected destination and constrain writes to a dedicated workspace directory. Reject traversal, symlink escapes, absolute paths, and overwriting without confirmation.
  4. If command execution must remain available, replace generic exec access with a narrow wrapper that invokes only a fixed JSON parser, passes content through standard input, avoids shell interpretation, and enforces input-size, timeout, and resource limits.
  5. Require explicit user approval before any network request, display the destination domain, and prohibit transmitting JSON that may contain secrets unless the user knowingly authorizes it.
  6. Remove or narrow the generic API-integration and command-execution claims at lines 330–331 so the documented capabilities match the Skill's declared JSON-processing purpose.
  7. Replace the placeholder curl example with a clearly user-controlled endpoint and state that local parsing is the default. Avoid silent network behavior.
  8. Enforce sandboxing, outbound-network restrictions, filesystem isolation, and environment-variable filtering at the Agent platform level as defense in depth.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (9)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 218)May include surrounding context.

print(f"Error at line {e.lineno}, column {e.colno}: {e.msg}")

text

### 配合 curl 调试API响应
```bash
# 获取API响应并自动格式化
curl -s https://api.example.com/data | python -m json.tool

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The invocation scope is overly broad, suggesting use in generic data analysis, reporting, statistics, and visualization rather than narrow JSON formatting tasks. Overbroad routing criteria can cause the agent to select this skill in unrelated contexts, increasing exposure to its unnecessary exec, write, and API-related capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description explicitly says the skill supports Chinese interaction, and elsewhere the document emphasizes Chinese interaction as a core capability without indicating that users may choose another language. This can violate language/locale policy expectations when no opt-in or language selection mechanism is documented.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 221)May include surrounding context.

配合 curl 调试API响应

bash
# 获取API响应并自动格式化
curl -s https://api.example.com/data | python -m json.tool

异常管理

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation introduces API key configuration and external API dependence without a clear need for local JSON formatting and validation. This creates unnecessary risk of secret handling, outbound data transmission, and user confusion about where JSON content may be sent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill claims broad capabilities such as file handling, API integration, and command execution that exceed the stated purpose of JSON formatting. This widens the apparent trust boundary and may cause an agent to invoke unnecessary high-risk tools for low-risk tasks, increasing the chance of data exposure or command abuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Describing command execution as a feature of a JSON formatting tool is unjustified and dangerous because it normalizes use of an execution primitive where none is needed. In an agent environment, this can lead to arbitrary shell command invocation on user-controlled content or unnecessary escalation from safe data transformation to code execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The core feature banner highlights Chinese interaction as a defining behavior, but does not say users can choose another language. Repeated natural-language statements that imply a fixed locale can create a policy issue even if the rest of the skill is bilingual.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The feature list says the skill detects syntax issues including trailing commas, single quotes, and comments and pinpoints line/column locations, suggesting active handling of those non-standard JSON constructs. Later, the limitations say JSON5/JSONC extensions such as comments, trailing commas, and single quotes are not supported, which creates a direct documentation contradiction about intended behavior.

Content

No source excerpt is available for this finding.