Back to skill

Security audit

DeepMiner Skills

Security checks for vulnerabilities and agentic risk

Overview

This DeepMiner helper is mostly purpose-aligned, but it ships under-scoped polling and forwarding behavior plus exploitable shell scripts that deserve manual review before installation.

Install only if you trust the DeepMiner CLI publisher and are comfortable giving it an AccessKey. Prefer pinning and reviewing the CLI version, avoid running npm with elevated privileges, keep DM outputs and file links treated as sensitive, and do not pass untrusted timeout or session-key arguments to the bundled polling scripts.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/dm-poll-notify.sh:24
Finding

Command Injection Through Unvalidated Arithmetic Input

Content
View full analysis
[parent_session_key] [max_timeout_minutes]" exit 3 fi # 轮询间隔(秒):递增策略 INTERVALS=(5 10 20 40 60) interval_idx=0 total_seconds=0 max_seconds=$((MAX_TIMEOUT * 60)) ``` `scripts/dm-poll-once.sh`: ```bash THREAD_ID="$1" STATUS_FILE="$2" MAX_TIMEOUT="${3:-60}" if [ -z "$THREAD_ID" ] || [ -z "$STATUS_FILE" ]; then echo "DM_POLL_ERROR:参数错误" exit 3 fi INTERVALS=(5 10 20 40 60) interval_idx=0 total_seconds=0 max_seconds=$((MAX_TIMEOUT * 60)) ``` `scripts/dm-poll.sh`: ```bash THREAD_ID="$1" STATUS_FILE="$2" MAX_TIMEOUT="${3:-60}" # 默认 60 分钟 if [ -z "$THREAD_ID" ] || [ -z "$STATUS_FILE" ]; then echo "用法: $0 [max_timeout_minutes]" exit 1 fi # 轮询间隔(秒):递增策略 INTERVALS=(5 10 20 40 60) interval_index=0 total_seconds=0 max_seconds=$((MAX_TIMEOUT * 60)) ``` ### Technical Analysis All three scripts accept the maximum timeout as an externally supplied positional argument and place it directly into a Bash arithmetic expression without validating that it is a decimal integer. Bash arithmetic evaluation is not equivalent to parsing a simple integer. Expressions can contain variable references and array subscripts, and evaluation of crafted array-subscript expressions can result in command substitution. Consequently, quoting the value when it is assigned to `MAX_TIMEOUT` does not make its later arithmetic evaluation safe. This issue is reachable before polling begins and does not depend on a malicious DeepMiner response. ### Attack Path 1. An attacker gains control over, or persuades an ...[truncated 1417 chars]
Remediation
View remediation
&2 exit 3 fi if (( 10#$MAX_TIMEOUT < 1 || 10#$MAX_TIMEOUT > 1440 )); then echo "Error: max_timeout_minutes must be between 1 and 1440" >&2 exit 3 fi max_seconds=$((10#$MAX_TIMEOUT * 60)) ``` Apply the same validation to all three polling scripts. Additional hardening should include: - Validate every positional argument according to a strict allowlist. - Use `printf '%s\n'` rather than `echo` for externally derived values. - Add automated tests that reject whitespace, signs, variable names, array syntax, command substitutions, and excessively large numbers. - Consider implementing timeout parsing in a language with strict numeric conversion if the scripts grow more complex. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:73
Finding

Predictable Shared Temporary Cache Allows Symlink and Cache-Poisoning Attacks

Content
View full analysis
/dev/null || stat -c %Y "$CACHE_FILE") )) -lt 86400 ]; then LATEST=$(cat "$CACHE_FILE") else LATEST=$(curl -sL "https://clawhub.ai/dmpm-mininglamp/deepminer-skill" | grep -o 'version:"[^"]*"' | head -1 | cut -d'"' -f2) echo "$LATEST" > "$CACHE_FILE" fi ``` ### Technical Analysis The mandatory version-check procedure uses a fixed filename in the globally shared `/tmp` directory. It neither creates a private directory nor verifies the file's owner, permissions, type, or symlink status before reading from or truncating it. An attacker with local access can pre-create `/tmp/dmskills_version_cache` as an attacker-controlled regular file to poison version-check results. On systems where symlink protections do not prevent the operation, the attacker can instead create a symbolic link pointing to another file. The redirection: ```bash echo "$LATEST" > "$CACHE_FILE" ``` then follows the symbolic link and truncates or overwrites the target using the victim process's privileges. The check and subsequent read or write are also separate operations, creating a time-of-check/time-of-use race. ### Attack Path #### Cache poisoning 1. A local attacker creates `/tmp/dmskills_version_cache`. 2. The attacker inserts a fabricated version value and gives the file a recent modification time. 3. A victim follows the documented mandatory version-check procedure. 4. The script considers the cache fresh and reads the attacker-controlled value. 5. The fabricated value can cause a false outdated-version warning or suppress a legitimate update warning. #### Symlink attack 1. A local attacker creates `/tmp/dmskills_version_cache` as a symbolic link to a file writable by the ...[truncated 1090 chars]
Remediation
View remediation
"$tmp_file" chmod 600 "$tmp_file" mv -f -- "$tmp_file" "$CACHE_FILE" trap - EXIT ``` Additional safeguards should include: - Verify that the cache directory is owned by the current user and is not a symbolic link. - Reject a cache file that is a symbolic link or not owned by the current user. - Enforce restrictive permissions such as mode `0700` for the directory and `0600` for the file. - Validate the fetched and cached version against a strict semantic-version pattern before using it. - Prefer a cache implementation that safely opens files with no-follow and exclusive-creation semantics. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:14
Finding

Unpinned Global npm Installation Creates a Supply-Chain Execution Risk

Content
View full analysis
Remediation
View remediation
``` Only use `--ignore-scripts` if the audited package does not legitimately require installation scripts. Otherwise, review and verify those scripts before installation. Further hardening should include: - Document the expected npm registry and verify it before installation. - Record and verify the package integrity digest or signed provenance. - Prefer a project-local installation with a committed lockfile over a global installation. - Avoid running npm with `sudo` or another privileged account. - Verify the package name, publisher, version, and signature before use. - Pin the CLI version expected by the skill and explicitly review version upgrades. - Execute the CLI in a sandbox with only the filesystem and network permissions required for DeepMiner operations. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个广义的“通过 dm-cli 与 DM 系统交互”的技能/指导入口,强调何时应先阅读该 Skill;但给出的代码并不是通用交互层,也不是面向用户的操作说明,而是一个具体的后台监控脚本。它的核心行为是定时轮询某个 thread_id 的状态,并借助 sessions_send 把状态变化异步通知给主会话。这属于更具体且额外的能力,尤其是跨会话通知和轮询监控,并未在声明中体现。因此描述未准确代表代码的实际行为,构成明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description presents this as a general skill for interacting with DM through dm-cli and says it should be read before any DM-related task. However, the actual code chunk is not general interaction logic or guidance; it is a narrowly scoped polling utility for monitoring one DM thread result. It also performs additional capabilities not mentioned in the description: persisting thread state/results to local files and proactively sending notifications directly to the user via external messaging tools. Those are material behaviors beyond the declared purpose, so the description does not accurately represent the supplied code.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation trigger is extremely broad and mandates loading this skill for essentially any DM-related mention. Overbroad activation increases the chance that the agent will invoke powerful external-tool workflows, background polling, or credential-dependent actions in contexts where they are unnecessary or not explicitly intended by the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill tells the agent to globally install a CLI and initialize it with an AccessKey, but provides no warning, consent gate, or handling guidance for sensitive credentials. This can lead to credential exposure, unintended persistence of secrets, or unreviewed execution of third-party code on the host environment.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill requires verbatim forwarding of all DM outputs and attachments without review, minimization, or redaction. If DM returns secrets, personal data, proprietary files, or unexpected sensitive artifacts, the agent is instructed to disclose them wholesale to the user or another session, creating a direct data exfiltration path.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

One section says the polling subagent should use a message/send tool to notify the user directly, while a later 'correct version' says subagents must not use message or sessions_send and should instead stop and rely on subagent output propagation. These are active contradictions in the skill's operational guidance, creating intent-code divergence in how the agent is supposed to behave.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The async completion flow directs the agent to notify users with full results and file links directly, encouraging unrestricted artifact disclosure. In context, DM may process large datasets or media, so returning all outputs blindly can leak sensitive derived data, internal URLs, or access-controlled files.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The polling subagent is explicitly told to traverse all messages and emit every assistant message and attachment link verbatim. This automates unrestricted disclosure from the external DM system and increases risk because it happens in a background workflow with less opportunity for human review before release.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file title and all user-facing instructional content are written exclusively in Chinese, and the examples of what to tell the user are also mandated in Chinese. This creates a language/locale constraint without any indication that the user may choose another language or opt in to Chinese output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script forwards the full polled DM result to another session via sessions_send, including whatever content DM returned, without any consent check, redaction, or minimization. In this skill context, DM interactions may contain sensitive prompts, outputs, identifiers, or human-directed questions, so cross-session forwarding can leak data to an unintended recipient if the parent session key is wrong, shared, or attacker-controlled.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This shell script contains natural-language comments, usage text, and later user-facing notification strings exclusively in Chinese. The policy requires flagging language/locale constraints when a skill forces a specific language without user opt-in, and no alternative language choice or region-specific justification is documented here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The header documentation says state changes will notify the user and that the user receives results without main-agent involvement. However, notify_user only attempts message or sessions_send if present and suppresses failures with || true, so in some environments no notification is sent despite the documented claim.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script writes the full DM result JSON directly into a status file, which can expose sensitive task outputs, internal metadata, or user-provided content to other local users, logs, or downstream tooling that reads the file. In this skill context, DM interactions likely carry operational or business data, so persisting the entire JSON without minimization or access controls increases the chance of unintended data disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains user-facing natural-language content in Chinese, but there is no indication that the skill is intentionally region-specific or that users can choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs fetching a remote webpage with curl and parsing it to determine whether the local skill is current. This introduces an unnecessary external trust dependency and can expose metadata, enable content spoofing, or cause the agent to follow attacker-controlled update guidance if the remote page or network path is compromised.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description is written only in Chinese ("通过 dm-cli 命令行工具与 DeepMiner (DM) 系统交互"), which indicates a language-specific presentation without any stated user choice or opt-in. Under the policy, language constraints should either offer a choice or be clearly documented as justified for a specific locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file's usage instructions, comments, and runtime messages are presented in Chinese only, with no option for the user to select another language. This creates a natural-language policy issue because the skill effectively imposes a specific language/locale without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's comments and runtime user-facing output are in Chinese, and there is no indication that the user can choose another language or that the locale restriction is intentional. This can violate language/locale policy when skills are expected to avoid forcing a specific language without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.