Back to skill

Security audit

Engineering Mode

Security checks for vulnerabilities and agentic risk

Overview

This coding workflow skill is mostly coherent, but its automatic recovery guidance includes unsafe Git rollback commands that can discard or delete unrelated work.

Review this skill before installing in repositories with valuable uncommitted work. If used, require explicit confirmation before any reset, checkout, or branch deletion, replace wildcard branch cleanup with exact branch names, and prefer local locked lint/test tools instead of unpinned npx.

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)

T08 · Insecure Dependencies

Warning
Location
references/validate-strategies.md:9
Finding

Unpinned npx Commands May Download and Execute Untrusted Packages

Content
View full analysis

Vulnerability Details

File Location: references/validate-strategies.md:9-10, 28, 54
Vulnerability Type: Supply-chain exposure through unpinned dependency execution
Risk Level: Medium

Vulnerable Code:

markdown
| JavaScript/JSX | `npx eslint <file>` | Single-file lint |
| TypeScript/TSX | `npx eslint <file>` | Prefer linting without type checking |
markdown
| JavaScript/TS | `npx jest <test-file> --no-coverage` | Single test file |
bash
timeout 10 npx eslint src/file.ts 2>&1

Technical Analysis

The validation instructions execute eslint and jest through npx without requiring an exact package version, a verified lockfile, a preinstalled local binary, or an option that prohibits package installation.

Depending on the npm version and configuration, when the requested executable is unavailable locally, npx may resolve and download a package from the configured registry before executing it. This converts a local validation step into a supply-chain execution path whose effective code may change after the Skill has been reviewed.

Package executable code and installation lifecycle scripts run with the same operating-system privileges as the Agent. A compromised package release, malicious registry configuration, dependency-confusion condition, or package-resolution mistake could therefore result in arbitrary local command execution.

Attack Path

  1. The Skill is activated for a JavaScript or TypeScript editing task.
  2. The mandatory verification stage selects npx eslint or npx jest.
  3. The corresponding package executable is not installed in the project.
  4. npx resolves the package through the configured package registry.
  5. A compromised, substituted, or otherwise untrusted package is downloaded.
  6. Package installation hooks or the resolved executable run with the Agent's user privileges.
  7. The malicious code can access file ...[truncated 795 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require eslint and jest to be declared in the project's development dependencies with versions governed by a committed lockfile.
  2. Prohibit automatic package installation during verification:
    bash
    timeout 10 npx --no-install eslint src/file.ts 2>&1
    timeout 30 npx --no-install jest tests/file.test.ts --no-coverage 2>&1
    
  3. Prefer explicit local binaries where supported:
    bash
    timeout 10 ./node_modules/.bin/eslint src/file.ts 2>&1
    
  4. Fail safely when the required local executable is absent rather than retrieving it automatically.
  5. Require explicit user authorization before installing any missing dependency.
  6. Validate lockfile integrity and use a trusted, explicitly configured package registry.
  7. In higher-assurance environments, run dependency-backed validation in a sandbox with restricted filesystem, credential, and network access.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:115
Finding

Overbroad Git Recovery Commands Can Destroy Unrelated Work and Branches

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:115-120; duplicated in references/error-recovery.md:73-78
Vulnerability Type: Unsafe repository rollback and wildcard branch deletion
Risk Level: High

Vulnerable Code:

bash
# Dynamically obtain the latest checkpoint
LATEST_CHECKPOINT=$(git log --grep="^checkpoint:" -1 --format=%H)
git reset --hard $LATEST_CHECKPOINT

# Alternatively, return to the original branch and discard temporary branches
git checkout $ORIGINAL_BRANCH
git branch -D eng-mode-*

The same recovery commands are repeated in references/error-recovery.md:

bash
# Option A: return to checkpoint
LATEST_CHECKPOINT=$(git log --grep="^checkpoint:" -1 --format=%H)
git reset --hard $LATEST_CHECKPOINT

# Option B: return to the original branch and discard temporary branches
git checkout $ORIGINAL_BRANCH
git branch -D eng-mode-*

Technical Analysis

The rollback logic derives the target commit from a repository-wide commit-message search rather than retaining the exact checkpoint identifier created by the current Skill run. It does not verify that the result is nonempty, belongs to the current temporary branch, or represents the current operation's safety checkpoint.

Consequently, the command may select an older or unrelated commit whose message begins with checkpoint:. Running git reset --hard against that commit moves the current branch and overwrites tracked working-tree changes. Any uncommitted tracked modifications are discarded.

The alternate recovery path uses git branch -D eng-mode-*. Shell wildcard expansion can select every local branch whose name matches the pattern, not merely the branch created by the current run. Forced deletion with -D bypasses merged-branch checks, so unrelated or unmerged work can be removed.

The logic also depends on $ORIGINAL_BRANCH surviving between command invocations. If commands run in separate shell sessions or t ...[truncated 2021 chars]

Remediation
View remediation

Remediation Suggestions

  1. Capture the exact checkpoint commit immediately after creating it:

    bash
    CHECKPOINT_HASH=$(git rev-parse HEAD)
    

    Persist it in operation-specific state rather than rediscovering it through commit-message search.

  2. Persist the exact original and temporary branch names in a reliable per-run state record. Do not rely on shell environment variables surviving across independent tool calls.

  3. Validate all rollback identifiers before any destructive operation:

    bash
    test -n "$CHECKPOINT_HASH" || exit 1
    git cat-file -e "${CHECKPOINT_HASH}^{commit}" || exit 1
    test -n "$TEMP_BRANCH" || exit 1
    
  4. Confirm that the checkpoint is associated with the current operation and that the current repository and branch match the recorded state.

  5. Avoid git reset --hard by default. Prefer restoring only the files changed by the current operation or use a non-destructive strategy such as git reset --keep where appropriate.

  6. Before discarding changes, display git status, git diff, and the exact rollback target, then require explicit user approval.

  7. Replace wildcard deletion with deletion of the exact recorded temporary branch:

    bash
    git branch -d -- "$TEMP_BRANCH"
    

    Use forced deletion only after explicit confirmation and verification that the branch belongs to the current operation.

  8. Quote every variable and use an end-of-options marker where supported:

    bash
    git checkout -- "$ORIGINAL_BRANCH"
    
  9. If repository state cannot be validated unambiguously, stop recovery and report the condition rather than attempting an automatic destructive rollback.

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 (12)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

git reset --hard $LATEST_CHECKPOINT is a destructive command that can irreversibly discard uncommitted or untracked work when executed in the wrong context or with an unexpected checkpoint resolution. Because the skill frames it as a standard recovery action, an agent may treat it as approved procedure and execute it without adequately checking whether the repository state is safe.

Content

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

bash
# 动态获取最近 checkpoint(不依赖环境变量传递)
LATEST_CHECKPOINT=$(git log --grep="^checkpoint:" -1 --format=%H)
git reset --hard $LATEST_CHECKPOINT

# 或:直接切回原分支,丢弃临时分支
git checkout $ORIGINAL_BRANCH

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

git reset --hard <checkpoint-hash> is a destructive command that forcibly rewrites the working tree and index, potentially deleting local modifications and causing irreversible loss if the checkpoint is wrong or absent. Within this skill, the command is embedded as part of an error-recovery state machine, which makes it especially risky because an agent may treat it as an approved automatic remediation step during VERIFY failure.

Content

Scanner excerpt · references/error-recovery.md (reported line 37)May include surrounding context.

│ ▼ 4. 回退 切回原分支 / git reset --hard → 分析原因 → 报告用户 → 等待指示

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

The sample shell snippet directly recommends git reset --hard $LATEST_CHECKPOINT, which can destroy uncommitted changes and trusts a dynamically derived commit value without a safety interlock. Because this is presented as the recommended recovery path in an engineering-mode skill, it materially increases the likelihood that an agent or operator will execute it during stressful failure scenarios without adequate validation.

Content

Scanner excerpt · references/error-recovery.md (reported line 74)May include surrounding context.

bash
# 方案 A:回到 checkpoint(推荐)
LATEST_CHECKPOINT=$(git log --grep="^checkpoint:" -1 --format=%H)
git reset --hard $LATEST_CHECKPOINT

# 方案 B:切回原分支,丢弃临时分支
git checkout $ORIGINAL_BRANCH

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The metadata says the mode is forcibly triggered for broad coding/editing scenarios, which can override normal user intent and push the agent into a prescriptive workflow that includes git and execution actions. In skill systems, forced mode behavior increases the chance of unauthorized or surprising operations, especially when the skill later mandates branch creation, commits, and verification commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill includes destructive rollback instructions such as git reset --hard and branch deletion without an explicit safety warning or a required confirmation step about losing uncommitted work. In an agent skill, these instructions can be operationalized automatically, making accidental data loss materially more likely than in passive documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs use of destructive rollback commands that can permanently discard uncommitted work, but it does not prominently warn about data loss or require explicit user confirmation before execution. In an agent skill, this is more dangerous because the text operationalizes the command as a standard recovery step, increasing the chance an automated agent executes it reflexively during failure handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The markdown content is written entirely in Chinese and provides procedural instructions without any indication that the user can choose another language or that the skill is intentionally limited to a Chinese-language audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document’s operational instructions are written in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The document instructs use of npx eslint <file> without pinning a package version or requiring a locally installed dependency. npx may fetch and execute code from the registry at runtime, creating a supply-chain risk and reducing reproducibility if the package version changes or a malicious package version is served.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This TypeScript validation guidance again uses unpinned npx eslint <file>, which can execute whatever version is resolved at runtime. In an agent skill that may autonomously run commands, this increases the chance of unintended remote code execution through package resolution or dependency compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The recommended npx jest <test-file> --no-coverage command is unpinned and may download/execute an arbitrary version of Jest and its transitive dependencies. Because this file is a command reference for an agent's VERIFY phase, the skill context makes the issue more dangerous: operators may treat the command as trusted and run it automatically.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The timeout example still uses unpinned npx eslint, so the same supply-chain/runtime-fetch risk appears in the operational example users are likely to copy directly. Copy-pasteable examples are particularly risky because they normalize executing network-resolved tooling as part of automated validation.

Content

No source excerpt is available for this finding.