Back to skill

Security audit

deepresearchwork forme

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Chinese report generator, but it automatically downloads and runs an unpinned npm chart tool, which warrants review before installation.

Review this skill before installing if your agent environment has access to sensitive files, credentials, or unrestricted network access. Use a pinned, reviewed Mermaid CLI installation or a sandboxed chart conversion path instead of allowing automatic `npx -y` downloads during report generation.

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

T08 · Insecure Dependencies

Warning
Location
scripts/convert_charts.sh:34
Finding

Unpinned npm Dependency Is Automatically Downloaded and Executed

Content
View full analysis

Vulnerability Details

File Location: scripts/convert_charts.sh:34-39
Additional Locations: SKILL.md:160, SKILL.md:164, SKILL.md:296, SKILL.md:333
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: Medium

Vulnerable Code

bash
if npx -y @mermaid-js/mermaid-cli \
    -i "$mmd_file" \
    -o "$output_file" \
    -b "$BACKGROUND" \
    -w "$WIDTH" \
    2>/dev/null; then

The documentation also repeatedly recommends the same unsafe installation and execution pattern:

bash
npx -y @mermaid-js/mermaid-cli -i chart.mmd -o chart.png -b transparent -w 1200

Technical Analysis

The conversion script invokes npx with -y, allowing npm to download and execute @mermaid-js/mermaid-cli without interactive confirmation. The command does not pin an exact package version and the project contains no reviewed lockfile or integrity metadata governing the downloaded package and its transitive dependencies.

Although SKILL.md describes the dependency as ^11.0.0, that range is not enforced by the executable command and would not constitute an immutable pin in any case. Consequently, the code that executes during a future Skill run can differ from the code reviewed during this audit. npm lifecycle scripts and the downloaded CLI execute with the privileges of the account running the Agent.

This is a supply-chain exposure rather than evidence that the current Mermaid package is malicious.

Attack Path

  1. An attacker compromises the npm publisher account, a transitive dependency, the configured npm registry, or the package delivery path.
  2. The attacker publishes or serves a malicious version of @mermaid-js/mermaid-cli or one of its dependencies.
  3. A user invokes the chart-conversion workflow.
  4. npx -y resolves and downloads the uncontrolled package release without prompting the user.
  5. npm lifecycle logic or the downloaded CLI executes the attacker's code under the Agent user's identity.

...[truncated 689 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin @mermaid-js/mermaid-cli to an exact, reviewed version rather than resolving the latest available release.
  2. Add and commit a package manifest and lockfile containing integrity hashes for all transitive dependencies.
  3. Install dependencies in a separate, controlled setup phase with npm ci; do not download packages during report conversion.
  4. Invoke the verified local executable, such as ./node_modules/.bin/mmdc, instead of using runtime npx -y.
  5. Where compatibility permits, disable lifecycle scripts during installation with npm ci --ignore-scripts, then explicitly allow only required reviewed setup operations.
  6. Configure npm to use an approved registry and apply package provenance or signature verification where available.
  7. Run chart conversion in a sandbox with minimal filesystem access, a sanitized environment, no unnecessary credentials, and restricted outbound network access.
  8. Update every command example in SKILL.md so users are not directed to bypass the secured dependency workflow.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (16)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

The troubleshooting step includes rm -rf node_modules/.cache, a destructive shell command that recursively deletes files. Even though the target path is relatively scoped, shell cleanup commands in skills are dangerous because users or downstream agents may generalize, mis-execute, or run them in unintended directories, causing data loss or abuse of file-operation privileges.

Content

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

解决:

bash
# 清除缓存重试
rm -rf node_modules/.cache
npx -y @mermaid-js/mermaid-cli -i chart.mmd -o chart.png

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README presents the skill name, description, and usage exclusively in Chinese without stating a locale limitation or asking for user language preference. This can mislead users and host systems into invoking the skill under assumptions about language handling, potentially causing unintended execution paths, misunderstanding of outputs, or misuse by non-Chinese-speaking users.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The invocation phrase '帮我生成一份关于 [主题] 的深度产研报告' is very broad and closely resembles an ordinary user request rather than a distinctive skill trigger. This increases the chance of accidental activation or routing conflicts, which can cause the skill to run in unintended contexts and process topics the user did not explicitly mean to send to this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill describes automatic online searching, data collection, and file generation as part of its normal workflow, but does not clearly warn users that it will access the network and write output files. This reduces informed consent and can lead to unintended disclosure, policy violations, or unexpected file modifications in sensitive environments.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

The skill instructs use of npx -y @mermaid-js/mermaid-cli without pinning an exact package version, which allows whatever version is current at execution time to be downloaded and run. This creates a supply-chain risk: a compromised upstream release or unexpected breaking change could execute unreviewed code in the user's environment.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

The batch example again invokes npx -y @mermaid-js/mermaid-cli without an exact version pin, so execution depends on the latest package available at runtime. In a skill that automates report generation, this increases the chance of silently pulling and executing untrusted or changed code across multiple files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that the system will automatically detect and install @mermaid-js/mermaid-cli but does not clearly warn that this involves downloading and executing third-party tooling. In combination with npx -y, this can cause users to run remote code without meaningful review or consent.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

The documented 'automatic installation' command downloads and runs @mermaid-js/mermaid-cli without pinning a specific version. Because this is presented as an automatic system behavior, it is more dangerous than a passive example: users may not realize external code will be fetched and executed on demand.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

The troubleshooting command repeats the unpinned npx -y @mermaid-js/mermaid-cli pattern, preserving the same supply-chain exposure during error recovery. Troubleshooting paths are often copied verbatim, so they can normalize unsafe execution of unreviewed package versions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest sets the report language to "zh-CN" as a fixed default, which is a natural-language locale constraint. The provided file does not indicate any user choice, opt-in mechanism, or region-specific justification for forcing this locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script includes comments and user-visible output strings in Chinese only, such as the startup and completion messages. This imposes a fixed language choice on users without offering a locale option or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The script executes npx -y @mermaid-js/mermaid-cli without pinning an exact package version, causing each run to trust the current package registry state. If the package or one of its transient dependencies is compromised, a malicious release could execute arbitrary code on the host during chart conversion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file consistently uses Chinese for the title, commands, and instructional content, which effectively imposes a single language on users. There is no indication that the skill supports language selection or that the Chinese-only presentation is a documented, justified locale limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown example explicitly states that the skill outputs a report file and a directory of chart images in a local workspace. The description does not include any warning or disclosure that using the skill will create files on disk, which is a user-impacting behavior covered by the markdown warning criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration hard-codes the report language to zh-CN, which is a locale-specific constraint expressed in natural language/configuration. The document does not state that users can choose another language or that the locale restriction is required for a specific justified context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code creates a directory and writes converted PNG files to disk, which is a safety-relevant side effect for a code file. Although it prints progress information, there is no explicit user warning or confirmation that existing files in the output path may be created or overwritten during batch conversion.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.