Back to skill

Security audit

RxnIM

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but users should review it because it sends reaction images to a third-party service and gives unpinned local install commands that execute external code.

Install or use this only if you are comfortable sending reaction images to the named HuggingFace Space. Do not use the hosted path for unpublished, proprietary, regulated, or confidential chemistry data unless you have approval. If using local deployment, pin and review the repository, dependencies, model archive, and eval script, and run them in an isolated environment without unnecessary credentials or sensitive mounts.

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:74
Finding
Unpinned Remote Dependencies and Script Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 74–88 **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code ```bash # 1. 克隆仓库 git clone https://github.com/CYF2000127/RxnIM cd RxnIM # 2. 创建环境 conda create -n rxnim python=3.10 conda activate rxnim # 3. 安装依赖 pip install -r requirements.txt # 4. 下载模型权重(~14GB) # https://huggingface.co/datasets/CYF200127/RxnIM → RxnIM-7b.zip # 解压到本地路径,修改 config/_base_/dataset/DEFAULT_TRAIN_DATASET.py 中的路径 # 5. 推理 sh eval.sh ``` ### Technical Analysis The documented installation procedure clones the current state of a mutable external Git repository without pinning it to a reviewed commit or release. It then installs packages from the repository-controlled `requirements.txt` and executes the repository-controlled `eval.sh`. Neither the external repository files nor its transitive dependencies are included in the audited artifact. Their effective behavior can therefore change after this Skill has been reviewed. Python package installation may execute arbitrary build hooks, while the shell script can execute arbitrary commands directly. The separately downloaded model archive is also not protected by a documented checksum or signature. This creates a supply-chain trust boundary in which compromise of the repository, a referenced package, its package registry account, or the model distribution can result in local code execution. ### Attack Path 1. An attacker compromises the referenced repository, one of its dependency sources, or the model distribution account. 2. The attacker alters `requirements.txt`, substitutes a malicious package or version, modifies `eval.sh`, or replaces a model artifact with an unsafe file. 3. A user follows the local deployment instructions and clones the unpinned repository. 4. `pip install -r requirements.txt` executes malicious package installation or build logic, or `sh eval.sh` directly executes attacker-controlled shell commands. ...[truncated 817 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the external repository to a specific reviewed commit hash or cryptographically signed release rather than cloning the mutable default branch. 2. Provide a dependency lock file containing exact versions and verified hashes. Install dependencies with hash enforcement, such as `pip install --require-hashes`. 3. Review and vendor security-critical installation and inference scripts within the Skill package, or invoke a narrowly scoped, documented Python entry point instead of an externally mutable shell script. 4. Publish SHA-256 checksums or cryptographic signatures for model archives and require verification before extraction or loading. 5. Prefer non-executable model formats such as `safetensors`. Avoid loading untrusted pickle-based checkpoints or require explicitly safe deserialization settings. 6. Run installation and inference in an isolated environment, such as a dedicated container or unprivileged virtual machine, with no unnecessary credentials, host mounts, or network permissions. 7. Add an explicit warning that external repository code and model artifacts must be reviewed and verified before execution. 8. Use automated dependency and repository monitoring to detect compromised packages, vulnerable versions, or unexpected changes to pinned artifacts. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill recommends sending base64-encoded reaction images to a third-party HuggingFace Space but does not clearly warn users that uploaded content leaves the local environment. Reaction schemes may contain unpublished research, proprietary synthesis routes, or other confidential data, so silent transmission creates a real privacy and compliance risk.

External Transmission

Medium
Category
Data Exfiltration
Content
def parse_reaction_image(image_path: str, hf_space: str = "https://CYF200127-RxnIM.hf.space") -> dict:
    with open(image_path, "rb") as f:
        b64 = base64.b64encode(f.read()).decode()
    resp = requests.post(
        f"{hf_space}/run/predict",
        json={"data": [f"data:image/png;base64,{b64}"]},
        timeout=120
Confidence
91% confidence
Finding
The sample code performs an outbound POST containing the full image payload to an external endpoint. This is expected for a hosted inference service, but it is still a genuine external transmission path that can expose sensitive scientific or business information if used on confidential images without safeguards.

Context-Inappropriate Capability

Medium
Confidence
84% confidence
Finding
The workflow explicitly says images may be obtained from a user upload, URL, or file path, which expands the skill from image parsing into network retrieval of arbitrary resources. If an implementation follows this guidance without strict allowlists and validation, it can enable server-side request forgery, access to internal-only endpoints, or retrieval of sensitive content under the guise of image processing.

Static analysis

No suspicious patterns detected.