Back to skill

Security audit

度比对两个JSON文件的所有字段

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward JSON comparison helper, but users should be cautious with generated Excel reports from untrusted JSON.

Install only from a trusted Python package index, consider pinning openpyxl, avoid overwriting important .xlsx files, and do not open generated reports from untrusted JSON in a spreadsheet app unless formula-like values have been neutralized.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:337
Finding

Excel Formula Injection Through Attacker-Controlled JSON Values

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 337–338
Vulnerability Type: Excel formula injection
Risk Level: Medium

python
ws.cell(row=row, column=4, value=diff["expected"])
ws.cell(row=row, column=5, value=diff["actual"])

Technical Analysis

Values originating from the compared JSON files are converted to strings and written directly into Excel cells. The implementation does not neutralize values beginning with spreadsheet formula indicators such as =, +, -, or @.

Consequently, an attacker-controlled JSON value can be interpreted as a formula when the generated workbook is opened in a spreadsheet application. For example:

json
{
  "name": "=HYPERLINK(\"https://attacker.invalid/collect\",\"Open report\")"
}

If this value appears in the generated difference report, it may be evaluated as a spreadsheet formula rather than displayed as literal text. Although the identified lines directly expose the expected and actual columns, all other input-derived workbook fields should also be treated as potentially unsafe.

Attack Path

  1. An attacker creates or modifies one of the JSON files supplied to the comparison tool.
  2. The attacker places a formula-prefixed string in a field that differs between the two JSON documents.
  3. The comparator stores the malicious string in diff["expected"] or diff["actual"].
  4. export_to_excel writes the value directly into an Excel cell without escaping or forcing a text data type.
  5. A user opens the generated workbook in a spreadsheet application.
  6. The application evaluates the cell as a formula. Depending on the formula, application security settings, and user interaction, it can display a deceptive link or initiate an external request.

Impact Assessment

The issue affects users who open reports generated from untrusted or attacker-influenced JSON documents. An attacker may create deceptive spreadsheet content or potentially trigger outbound requests, which could ...[truncated 345 chars]

Remediation
View remediation

Remediation Suggestions

Sanitize every input-derived string before writing it to a workbook cell. At minimum, prefix strings beginning with =, +, -, or @ with an apostrophe so the spreadsheet treats them as text.

For example:

python
def sanitize_excel_value(value):
    if isinstance(value, str) and value.startswith(("=", "+", "-", "@")):
        return "'" + value
    return value

ws.cell(
    row=row,
    column=4,
    value=sanitize_excel_value(diff["expected"])
)
ws.cell(
    row=row,
    column=5,
    value=sanitize_excel_value(diff["actual"])
)

Apply the same sanitization to every potentially attacker-controlled field, including paths and descriptions. Where supported, explicitly configure cells as text. Add regression tests covering each formula prefix and verify the resulting workbook does not contain executable formulas in input-derived cells.

T08 · Insecure Dependencies

Note
Location
SKILL.md:56
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 56 and 547
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

bash
pip install openpyxl

The same installation instruction appears twice in the document.

Technical Analysis

The documented command installs whichever openpyxl release is selected by the package resolver at installation time. It does not constrain the dependency to a reviewed version and does not verify package integrity with cryptographic hashes.

The package name is consistent and the document does not specify a suspicious package index. Therefore, this is not evidence that the current package is malicious. The risk is that future installations are non-reproducible and automatically trust a release that may be incompatible, vulnerable, or compromised after this Skill has been reviewed.

Attack Path

  1. A user follows the Skill documentation and runs pip install openpyxl.
  2. pip queries the configured package index and resolves the current available release rather than a previously reviewed release.
  3. If the selected release or the configured package source has been compromised, installation may execute attacker-controlled package installation behavior.
  4. The installed package is subsequently imported by the JSON comparison code and executes with the privileges of the user running the tool.

This path requires an upstream package, distribution channel, or locally configured package index to be compromised; the audited project does not itself provide a malicious dependency source.

Impact Assessment

A compromised Python package could run code with the privileges of the account performing the installation or executing the comparator. That could expose files and environment data accessible to that account or modify user-owned resources.

No privilege escalation mechanism is present in the audited content. The direct, currently demonstrated impact is reduced dependency reproducibility ...[truncated 69 chars]

Remediation
View remediation

Remediation Suggestions

Pin openpyxl to a version that has been reviewed and tested by the project:

bash
pip install "openpyxl==<reviewed-version>"

Prefer a locked dependency file with cryptographic hashes and require hash validation during installation:

bash
pip install --require-hashes -r requirements.txt

The lock file should include hashes for the approved artifacts and all transitive dependencies. Install packages from a trusted, explicitly configured index, periodically review pinned versions for security updates, and update pins through a controlled testing and review process.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file states that the tool outputs differences to an Excel report, which is a file-writing operation affecting local user data. While file output is part of the tool's purpose, the documentation does not explicitly warn users that running the tool will create a local .xlsx file and may overwrite the specified output path.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.