Back to skill

Security audit

gen-test

Security checks for vulnerabilities and agentic risk

Overview

This testing skill is mostly coherent, but it asks agents to install and run unpinned third-party test tools and may write reusable Makefile targets, so it should be reviewed before installation.

Review the package-install and Makefile-generation steps before using this skill. Prefer pinned, project-local tools resolved through the repository lockfile, avoid global installs where possible, and only approve dependency installation or Makefile edits after checking the exact command and scope.

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

Unpinned Third-Party Package Installation and Execution

Content
View full analysis

Vulnerability Details

File Locations:

  • SKILL.md:61-75
  • coverage-recipes.md:11-41
  • coverage-recipes.md:56-62
  • coverage-recipes.md:82-92
  • coverage-recipes.md:118-120
  • coverage-recipes.md:185
  • coverage-recipes.md:209
  • coverage-recipes.md:272-290
  • coverage-recipes.md:307
  • coverage-recipes.md:385
  • coverage-recipes.md:435-449
  • coverage-recipes.md:565-603
  • coverage-recipes.md:618

Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Vulnerable Code

SKILL.md:61-75:

markdown
### Automatically install missing coverage tools

If the project has a test framework but lacks a coverage tool, install one automatically:

| Language | Condition | Installation command |
|----------|-----------|----------------------|
| Python | pytest exists but pytest-cov is absent | `pip install pytest-cov` |
| JS/TS (Jest) | No --coverage configuration | Built in; no installation required |
| JS/TS (Vitest) | No @vitest/coverage-* package | `npm install -D @vitest/coverage-v8` |
| Go | — | Built-in `go test -cover`; no installation required |
| Rust | No cargo-tarpaulin/llvm-cov | `cargo install cargo-llvm-cov` |
| Java (Maven) | No JaCoCo plugin | Add the JaCoCo plugin to pom.xml |
| Java (Gradle) | No jacoco plugin | Add `id 'jacoco'` to build.gradle |
| C#/.NET | No coverlet | `dotnet add package coverlet.collector` |

Confirm with AskQuestion before installation.

The original document is written partly in Chinese; the excerpt above is an English rendering of the complete affected section. The executable commands are reproduced exactly.

Representative commands from coverage-recipes.md:

bash
npm install -D @vitest/coverage-v8
npm install -D c8
pip install pytest-cov
cargo install cargo-llvm-cov

npx jest --coverage --coverageReporters=text --coverageReporters=lcov
npx vitest run --coverage --coverage.reporter=text --cover
...[truncated 3490 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every installed tool to an exact, reviewed version, for example:
    • pip install pytest-cov==<reviewed-version>
    • npm install --save-dev @vitest/coverage-v8@<reviewed-version>
    • cargo install cargo-llvm-cov --version <reviewed-version> --locked
  2. Prefer dependencies already declared in the project and resolved through committed lockfiles, such as package-lock.json, pnpm-lock.yaml, poetry.lock, or Cargo.lock.
  3. Prevent implicit downloads during execution. Use locally installed binaries and commands such as npx --no-install or an equivalent offline/local-only mode where supported.
  4. Display the exact resolved version, registry source, package name, and proposed command before requesting explicit user approval.
  5. Verify package hashes, signatures, attestations, or lockfile integrity where the ecosystem supports them.
  6. Disable package lifecycle scripts when they are unnecessary and supported, such as using npm's --ignore-scripts, after confirming that the selected tool does not require them.
  7. Install tools in an isolated virtual environment, container, or restricted build environment with minimal filesystem and network access.
  8. Avoid global installations such as dotnet tool install -g; use project-local tool manifests or isolated environments instead.
  9. Configure approved registries explicitly and protect against dependency confusion by validating package scope and registry mapping.
  10. Update all command templates in coverage-recipes.md so they use the same pinned, verified, and local-only dependency policy.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (27)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language description and document content are written to operate in Chinese, but there is no statement that the user can choose language or opt in to Chinese output. Under the policy, forcing a specific language or locale without user choice is a violation unless clearly documented as region-specific or otherwise justified.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
为已有项目生成单元测试和 E2E 测试。分析设计文档和函数签名(黑盒),
  评审可测试性设计缺陷,生成测试代码并产出覆盖率报告。
  Use when: "generate tests", "add tests", "补测试", "生成单测",
  "write unit tests", "add e2e tests", "测试覆盖率"。
  Proactively suggest when user has an existing project with insufficient
  test coverage and asks about quality or stability.
disable-model-invocation: true

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says to proactively suggest the skill whenever a user has an existing project with insufficient test coverage and asks about quality or stability. Phrases like asking about 'quality' or 'stability' are broad everyday development topics, and the file does not provide exclusion conditions or negative examples to constrain when the skill should or should not activate.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

文档在核心理念中声明“从函数签名和接口契约出发,不偷看实现”,并在 Phase 2 明确写出“禁止读取函数体”。但后续要求对函数做可测试性评审、识别诸如内部硬编码依赖、time.Now()/Math.random()、副作用、函数粒度等问题,这些通常必须查看函数实现才能判断,因此文档意图与实际流程要求存在直接冲突。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

标题及整份技能文档均以中文撰写,未见任何允许用户选择语言/区域设置的说明,也未说明该技能仅面向特定中文环境。按规则,这构成未获用户选择即强制特定语言/locale 的自然语言策略问题。

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The document instructs use of npx jest without pinning a package version or requiring a locally installed dependency. In environments where jest is not already locked in the project, npx may fetch and execute whatever version is currently published, creating a supply-chain risk and reducing reproducibility.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

This command again relies on unpinned npx jest, which can execute a remote package version if the tool is absent locally. That exposes users to unintended code execution from dependency confusion, compromised upstream releases, or simply breaking changes.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

Using npx jest with no explicit version allows dynamic retrieval and execution of code from the registry. In a test-generation skill that may be run automatically on many repositories, this increases supply-chain exposure across projects.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

The npx vitest invocation is unpinned and may cause runtime download and execution of an arbitrary published version when Vitest is not installed locally. That is a supply-chain and reproducibility issue, especially in automated workflows.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding

npx c8 without version pinning can fetch and run the latest package from the registry. Since coverage commands execute as developer tooling inside the repository context, a compromised or unexpected package version could run arbitrary code with developer privileges.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

npx mocha is unpinned and may download and execute a registry package at runtime. Because test runners execute project code and often have filesystem and network access, this increases the impact of a supply-chain compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

npx mocha is unpinned and may download and execute a registry package at runtime. Because test runners execute project code and often have filesystem and network access, this increases the impact of a supply-chain compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

This delta-coverage example again uses unpinned npx jest, exposing users to non-reproducible and potentially unsafe runtime package resolution. The skill context makes this more concerning because the guidance may be copied directly into automation or CI jobs.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
85% confidence
Finding

npx lcov-diff is unpinned and may fetch a package at execution time. Since the command may be run in CI against sensitive repositories, an unexpected package version could alter results or execute arbitrary code in the build environment.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The Makefile target embeds npx jest without pinning, which can propagate unsafe runtime package fetching into routine developer and CI workflows. Persisting this in generated build files amplifies the risk because users may trust and reuse it widely.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

This Makefile entry uses npx jest --config ... with no version pinning, enabling remote resolution of the executable. Because Makefiles are commonly run in automation, the command could introduce supply-chain execution risk into CI pipelines.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

An unpinned npx jest in coverage targets may execute an unintended version and produce different behavior or arbitrary code execution. The test-generation context increases exposure because the skill may automatically author these commands into many repositories.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

This target writes another unpinned npx jest invocation into persistent build configuration. The danger is not just one-off execution; it normalizes insecure package retrieval in repeated developer and CI use.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The HTML coverage target again depends on unpinned npx jest, preserving the same supply-chain risk. Since this skill generates automation snippets, unsafe examples can be operationalized directly by users with little review.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

npx vitest run without version pinning may fetch and execute a remote package version when used in generated Makefiles. This creates supply-chain risk and non-deterministic behavior in local and CI environments.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

This e2e target uses unpinned npx vitest, which could download and run an unexpected package release. Test tooling runs with repository access, so compromise could affect source code, secrets in CI, or published artifacts.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

The coverage target's npx vitest call is another instance of unpinned dynamic package execution. In a skill focused on generating reusable testing infrastructure, these examples can spread insecure defaults broadly.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

The delta-coverage target again relies on unpinned npx vitest, allowing remote resolution at execution time. That can lead to arbitrary code execution or silent toolchain drift in CI.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

This HTML report target embeds unpinned npx vitest, carrying the same supply-chain risk into persistent automation. The context makes it more dangerous because users may treat generated Makefile recipes as best practice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file enforces a specific language for all users by presenting all instructions solely in Chinese. Under the policy, forcing a language or locale without user opt-in is a natural-language policy violation unless the restriction is clearly justified, which is not stated here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.