Back to skill

Security audit

cs

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed diagnostics tool, but it also exposes unrestricted shell command execution and can run broader system and network checks than a user may expect.

Install only if you intentionally want a high-trust local diagnostics tool that can run shell commands as your agent user. Avoid using --cmd with untrusted input, review outputs before sharing them, and be aware that network tests contact external hosts and reports may contain host, user, network, and filesystem details.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
cmd-executor.mjs:21
Finding

Documented CLI Syntax Causes Unintended Full-System Reconnaissance

Content
View full analysis
a.startsWith('--format'))?.split('=')[1] || 'json', type: process.argv.find(a => a.startsWith('--type'))?.split('=')[1] || 'all', customCmd: process.argv.find(a => a.startsWith('--cmd'))?.split('=')[1], timeout: 30000, maxOutputLength: 10000 }; ``` The resulting value controls the execution scope: ```js if (CONFIG.customCmd) { const customResult = executeCommand(CONFIG.customCmd); customResult.type = 'custom'; results.push(customResult); } else { switch (CONFIG.type) { case 'systeminfo': results = executeCommandGroup(getSystemInfoCommands(), 'systeminfo'); break; case 'network': results = executeCommandGroup(getNetworkCommands(), 'network'); break; case 'filesystem': results = executeCommandGroup(getFilesystemCommands(), 'filesystem'); break; case 'all': default: results = [ ...executeCommandGroup(getSystemInfoCommands(), 'systeminfo'), ...executeCommandGroup(getNetworkCommands(), 'network'), ...executeCommandGroup(getFilesystemCommands(), 'filesystem') ]; break; } } ``` ### Technical Analysis The argument parser only supports values supplied in the `--key=value` form because it splits the matched argument on `=`. However, `SKILL.md` documents space-separated usage such as: ```bash node cmd-executor.mjs --type systeminfo node cmd-executor.mjs --type network node cmd-executor.mjs --cmd "whoami && hostname" ``` For `--type systeminfo`, `process.argv` contains two separate entries: `--type` and `systeminfo`. Splitting `--type` on `=` produces no value, causing the expression to fall back to `all`. The `default` switch branch also ...[truncated 2072 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
cmd-executor.mjs:44
Finding

Unrestricted Custom Commands Are Executed Through a System Shell

Content
View full analysis
CONFIG.maxOutputLength ? output.substring(0, CONFIG.maxOutputLength) : output; result.success = true; } catch (error) { result.error = error.message; result.output = error.stderr || ''; } return result; } ``` The custom command is passed directly to that function: ```js if (CONFIG.customCmd) { const customResult = executeCommand(CONFIG.customCmd); customResult.type = 'custom'; results.push(customResult); } ``` ### Technical Analysis `execSync()` executes a string through the operating system's shell. The `CONFIG.customCmd` value is passed to it without validation, an executable allowlist, argument separation, or shell metacharacter filtering. When custom command mode is invoked using the implementation-supported syntax, such as: ```bash node cmd-executor.mjs '--cmd=whoami && hostname' ``` the shell interprets operators including command chaining, pipelines, redirections, substitutions, and other platform-specific syntax. The command is not restricted to the diagnostic operations listed in the documentation. The 30-second timeout and output-length limit do not provide a security boundary. They only constrain how long the direct process is allowed to run and how much successful standard output is retained. A command can still modify files, disclose local data, initiate network traffic, or start detached child processes before the timeout. This issue is exploitable ...[truncated 2055 chars]
Remediation
View remediation
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 (14)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is presented as a system diagnostics tool, but its documented behavior includes unrestricted shell command execution through the associated executor, creating a mismatch between expected and actual capability. That mismatch increases risk because operators may approve or invoke the skill for benign diagnostics while unknowingly granting a general command-execution primitive.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly documents a custom execution mode using --cmd that accepts arbitrary shell commands, which expands the capability from bounded diagnostics to unrestricted command execution. In an agent skill context, this is dangerous because user prompts or downstream instructions could be translated into attacker-controlled commands, leading to arbitrary code execution, data theft, system modification, or lateral movement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script presents itself as a diagnostics tool, but it explicitly supports arbitrary command execution via the --cmd argument. In an agent skill context, this enables a caller to run any shell command with the privileges of the agent process, far exceeding normal diagnostic scope and creating a direct remote code execution path.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code reads a raw command string from process arguments and passes it directly into execSync, which invokes a shell. This creates arbitrary command execution and shell injection risk by design, allowing an attacker to execute destructive commands, exfiltrate data, or pivot from the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

When --cmd is supplied, the script immediately executes the provided command without confirmation, warning, or policy gating. In an agent setting this lowers friction for misuse and turns accidental or malicious input into immediate code execution on the host.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This section explicitly defines 'malicious_tests' containing privilege enumeration, sensitive-information filtering, and network reconnaissance commands. Even if framed as detection tests, the skill packages offensive reconnaissance primitives that could be invoked directly or repurposed by an agent, increasing the risk of unauthorized host and network discovery.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill documentation states it will collect system information including network configuration and environment variables, but it does not prominently warn that these outputs may contain sensitive secrets, tokens, internal hostnames, usernames, or infrastructure details. In a diagnostic skill, omission of this warning can lead to accidental over-collection, unsafe sharing, or exposure of sensitive local data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documented command writes a diagnostic report to diagnosis-report.json without a specific warning that the file is created on disk and may contain sensitive host, user, network, and environment data. Persisting such data locally increases exposure through later access by other users, backup systems, malware, or accidental publication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Commands like ping, traceroute, and nslookup send traffic to external systems and reveal aspects of the local network environment without explicit disclosure or consent. Even if intended for diagnostics, this can leak operational details and trigger security monitoring or violate environment restrictions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The network diagnostics perform outbound probing to external hosts such as 8.8.8.8 and example.com, which can disclose host/network metadata and create unexpected external communications. In restricted or sensitive environments, this broadens the skill from local diagnostics into active network interaction that may violate policy or leak environmental information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest frames the skill as collecting system information and performing security checks, which clearly covers systeminfo and network diagnostics. However, this file also includes generic filesystem discovery commands such as directory listing, recursive tree enumeration, and binary location lookup, which broaden the behavior into local file-system reconnaissance rather than clearly bounded environment diagnostics.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The test scenarios are broadly named and described, such as '完整安全诊断', without clear preconditions, authorization requirements, or execution limits. In an agent setting, vague scenario definitions can cause overbroad command execution, leading to unnecessary system enumeration, network probing, or collection of sensitive host information.

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's natural-language usage documentation is written in Chinese, and generated Markdown/status strings are also hardcoded in Chinese. This imposes a specific language on users without any visible opt-in or locale selection mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

All human-facing descriptions and scenario labels in the file are written in Chinese, with no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy rule for language/locale, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
cmd-executor.mjs:58