Back to skill

Security audit

Chatmosp Kmc Simulator

Security checks for vulnerabilities and agentic risk

Overview

The skill's simulation purpose is clear, but it relies on running an unverified external Python wrapper and Windows executable with loosely scoped shell commands.

Install only if you trust the source of mosp-for-chatMOSP and can verify the exact kmc_standalone.py and engine/main.exe being run. Avoid using untrusted task names or paths, review commands before execution, and prefer running the simulator in a contained workspace or sandbox.

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

Error
Location
SKILL.md:182
Finding

Execution of Unpinned and Unverified External Components

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:182-185, 290, 326; equivalent instructions in SKILL_cn.md:182-185, 287, 322
Vulnerability Type: Third-party dependency and executable supply-chain risk
Risk Level: High

Vulnerable Code

bash
python3 {mosp_root}/kmc_standalone.py \
  --xyz OUTPUT/{task_dir}/ini.xyz \
  --json OUTPUT/{task_dir}/input.json \
  --out-dir {task_dir}
text
- **mosp-for-chatMOSP** — KMC engine (cloned, includes main.exe)
text
If a required companion skill is unavailable, ask the user to install the missing ChatMOSP skill from ClawHub before continuing. Use the GitHub repository only as a fallback.

Technical Analysis

The Skill directs the agent to execute an externally installed kmc_standalone.py script, which in turn runs a native Windows main.exe through Wine. It also instructs users to install companion Skills from ClawHub or, as a fallback, GitHub.

No canonical repository URL, immutable commit identifier, release version, cryptographic checksum, package signature, or verification procedure is specified for these components. The reviewed package therefore cannot establish the provenance or integrity of the code that will ultimately execute.

This is a supply-chain weakness rather than evidence that the current package contains malicious code. However, because the unverified dependency includes Python code and a native executable, compromise, repository takeover, dependency substitution, or installation of a similarly named package could result in arbitrary code execution.

Attack Path

  1. An attacker compromises the external repository, distribution account, or package associated with mosp-for-chatMOSP or a companion Skill.
  2. Alternatively, the attacker publishes a similarly named repository or package and induces the user or agent to install it.
  3. The user or agent clones or installs the dependency without validating an immuta ...[truncated 929 chars]
Remediation
View remediation

Remediation Suggestions

  1. Specify the canonical HTTPS repository and publisher identity for every external dependency.
  2. Pin mosp-for-chatMOSP and all companion Skills to immutable commit hashes or signed release versions.
  3. Publish and verify SHA-256 or stronger checksums for kmc_standalone.py, engine/main.exe, and other executable components before each first use or update.
  4. Prefer signed releases and validate signatures against a documented trusted public key.
  5. Reject execution if the dependency version, signature, or checksum does not match the approved manifest.
  6. Vendor reviewed dependencies where licensing permits, or audit the exact pinned source and executable artifacts separately.
  7. Run the simulation in a sandbox or container with restricted filesystem access, no unnecessary credentials, and limited network connectivity.
  8. Pin companion Skill versions instead of installing packages solely by name.
  9. Require explicit user confirmation before downloading, updating, or replacing executable dependencies.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:145
Finding

Shell Command and Path Injection Through Unquoted Placeholders

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:145-160, 182-185; equivalent instructions in SKILL_cn.md:145-160, 182-185
Vulnerability Type: Command injection, argument injection, and path traversal
Risk Level: Medium

Vulnerable Code

bash
mkdir -p OUTPUT/Pd_CO9_O18_473K_101325Pa_R50/KMC_{steps}steps/INPUT
mkdir -p OUTPUT/Pd_CO9_O18_473K_101325Pa_R50/KMC_{steps}steps/OUTPUT
bash
cp OUTPUT/{msr_task_name}/ini.xyz OUTPUT/{msr_task_name}/KMC_{steps}steps/ini.xyz
bash
cp mosp-for-chatMOSP/MOSP_database/{metal}-{reaction}.json \
   OUTPUT/{msr_task_name}/KMC_{steps}steps/input.json
bash
python3 {mosp_root}/kmc_standalone.py \
  --xyz OUTPUT/{task_dir}/ini.xyz \
  --json OUTPUT/{task_dir}/input.json \
  --out-dir {task_dir}

Technical Analysis

The documented shell commands interpolate task names, step counts, metal names, reaction names, task directories, and the MOSP root without quoting or defining validation constraints.

If an agent performs direct textual substitution and executes the generated command through a shell, shell metacharacters in one of these values can introduce additional commands, redirections, substitutions, or pipelines. Values beginning with a hyphen can also be interpreted as command options. Directory separators or .. components can escape the intended workspace and cause files to be read from or written to unintended locations.

The documentation does not explicitly state that these values must be generated internally or validated against an allowlist. Some values can be derived from user requests or task names, making unsafe substitution a plausible exploitation method.

Attack Path

  1. An attacker supplies a crafted task, metal, reaction, directory, or step value containing shell metacharacters, option prefixes, path separators, or traversal components.
  2. The agent substitutes that value directly into one of the documen ...[truncated 1438 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not construct shell commands through textual interpolation. Invoke processes with an argument array through a subprocess API that does not use a shell.
  2. Apply strict allowlists to task names, metal names, reaction names, and step values. For example, permit only letters, digits, periods, underscores, and hyphens where appropriate.
  3. Require step counts to parse as bounded positive integers rather than accepting arbitrary strings.
  4. Reject values containing .., directory separators, control characters, shell metacharacters, whitespace, or leading hyphens.
  5. Quote every shell variable expansion if shell execution cannot be eliminated.
  6. Use -- before positional file arguments where supported to prevent option injection.
  7. Resolve source and destination paths to canonical absolute paths and verify that they remain under the approved workspace and output roots before reading or writing.
  8. Construct task directories from server-generated identifiers rather than raw user-provided names.
  9. Check for symbolic links before writing sensitive output and use safe file-creation semantics to reduce link-based path redirection.
  10. Add negative tests covering command separators, command substitutions, traversal sequences, absolute paths, leading hyphens, spaces, and newline characters.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> - If the user writes in Chinese, read `SKILL.md` in this same directory and respond in Chinese.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
---
name: chatmosp-kmc-simulator
description: |
  chatMOSP 系统的 KMC(动力学蒙特卡洛)模拟引擎。调用 kmc_standalone.py 通过 Wine

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · SKILL_cn.md (reported line 1)May include surrounding context.

md
---
name: chatmosp-kmc-simulator
description: |
  chatMOSP 系统的 KMC(动力学蒙特卡洛)模拟引擎。调用 kmc_standalone.py 通过 Wine

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The routing instructions can force the agent to switch instruction sources based solely on detected language, even when the file-role description disagrees. That ambiguity can be exploited to steer execution into an unintended instruction set, especially in a multi-file skill where different files may contain different operational or safety constraints.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

3.2 安装 Wine(Ubuntu/Debian)

bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

3.2 安装 Wine(Ubuntu/Debian)

bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

3.2 安装 Wine(Ubuntu/Debian)

bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL_cn.md (reported line 54)May include surrounding context.

3.2 安装 Wine(Ubuntu/Debian)

bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL_cn.md (reported line 55)May include surrounding context.

3.2 安装 Wine(Ubuntu/Debian)

bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL_cn.md (reported line 56)May include surrounding context.

3.2 安装 Wine(Ubuntu/Debian)

bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The language-routing block is internally inconsistent: it says English users should read SKILL_cn.md, while Chinese users should continue with SKILL.md, but this file itself is labeled SKILL_cn.md in the prompt. In a skill system, contradictory instruction-source routing can cause the agent to follow the wrong document or attacker-controlled variant, creating instruction confusion and weakening policy enforcement.

Content

No source excerpt is available for this finding.