Back to skill

Security audit

chem-viz

Security checks for vulnerabilities and agentic risk

Overview

This is a legitimate chemistry visualization skill, with disclosed local HTML generation and a caution that some generated pages may use third-party CDN scripts.

Install only if you want a Chinese-language chemistry visualization helper that creates local HTML files. Prefer the zero-dependency Canvas2D path, and review generated HTML before sharing or opening pages that include remote CDN scripts.

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:64
Finding
Unpinned Remote JavaScript Dependencies in Generated HTML## Vulnerability Details **File Location**: `SKILL.md`, lines 64-66 **Vulnerability Type**: Unpinned executable third-party CDN dependencies **Risk Level**: Medium ### Vulnerable Code Snippet The relevant instruction, translated into English, is: ```text 1. Generate a complete HTML file and write it to the workspace directory. 2. Import CDN libraries: use the 3Dmol.org CDN for 3Dmol.js, cdnjs.cloudflare.com for JSXGraph, and cdn.jsdelivr.net for Three.js. 3. Use a Chinese interface for titles, labels, buttons, and prompts. ``` ### Technical Analysis The skill instructs the agent to place executable JavaScript from external CDNs into generated HTML pages. It does not require exact dependency versions, immutable URLs, cryptographic hashes, Subresource Integrity attributes, or a restrictive Content Security Policy. Consequently, the generated artifact may trust mutable third-party resources whose contents can change after the skill itself has been reviewed. If a CDN account, upstream release, DNS path, or distribution endpoint is compromised, a browser opening the generated page will execute the substituted JavaScript. Although later documentation recommends preferring local Canvas2D implementations, it does not remove or securely constrain this explicit CDN-import requirement. There is no evidence that the named CDNs currently serve malicious content; the vulnerability is the absence of supply-chain integrity controls. ### Attack Path 1. A user requests a chemistry visualization that uses 3Dmol.js, JSXGraph, or Three.js. 2. Following `SKILL.md`, the agent generates an HTML file containing a remote CDN script reference. 3. The dependency URL is unpinned or otherwise lacks cryptographic integrity verification. 4. An attacker compromises or gains influence over the selected upstream resource, CDN distribution path, or mutable release. 5. The user opens the generated page through the prescribed preview workflow. ...[truncated 728 chars]
Remediation
## Remediation Suggestions 1. Prefer audited dependencies stored locally with the skill or replace them with the documented zero-dependency Canvas2D implementation. 2. If remote dependencies are necessary, pin every library to an exact, immutable version and avoid aliases such as `latest`. 3. Add Subresource Integrity hashes to every external script and stylesheet: ```html <script src="https://trusted.example/library-X.Y.Z.min.js" integrity="sha384-EXPECTED_HASH" crossorigin="anonymous"></script> ``` 4. Apply a restrictive Content Security Policy that permits scripts only from explicitly approved origins and disallows unsafe inline execution where feasible. 5. Maintain an allowlist of approved CDN hosts, exact resource paths, versions, and expected hashes. 6. Extend `scripts/verify_output.sh` to reject unversioned remote resources, missing SRI attributes, unapproved hosts, and mutable dependency URLs. 7. Vendor and periodically audit dependencies when offline or `file://` compatibility is required.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The README states that chem-coach will automatically invoke this skill when it encounters molecule structure, equilibrium, or electrochemistry questions, but it does not define clear gating criteria, scope limits, or approval boundaries. In an agentic system, ambiguous auto-invocation can cause the skill to trigger in unintended contexts, expanding access to rendering/generation capabilities and increasing the chance of misuse, prompt-routing errors, or unsafe content generation.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest description emphasizes '零外部依赖' and 'file://协议100%可靠', which implies local, dependency-free operation. However, later instructions mandate CDN usage for 3Dmol.js, JSXGraph, and Three.js and require preview_url-based display, introducing external/network-dependent behavior that does not match the stated reliability and dependency claims.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases include broad terms such as general requests to 'draw' or 'visualize', which can cause the skill to activate in contexts the user did not intend. Unintended activation can lead to unexpected file generation, tool invocation, or workflow hijacking, especially because this skill is empowered to create HTML files and open previews.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill instructs the agent to write a complete HTML file into the workspace and open it, but does not require user notice or consent before creating artifacts. In an agent environment, silent file creation can surprise users, overwrite expected outputs, clutter the workspace, or be chained with other skills to stage unreviewed content for later execution or sharing.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The requirement "中文界面:标题、标签、按钮、提示全部中文" forces a specific language for generated output. The file does not present this as an opt-in preference or document a region-specific necessity, so it appears to violate language-choice policy.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The v1.1 note states that molecular 3D rendering was changed to pure Canvas2D and that 3Dmol.js/Three.js CDN dependencies were removed to fix file:// issues. Elsewhere, the document still directs the generator to use 3Dmol.js for molecular rendering and Three.js for crystal cells, which directly contradicts that stated change.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The script's user-facing comments and output messages are in Chinese, and line L42 explicitly checks for Chinese interaction prompts in the target HTML. This imposes a language requirement without any opt-in or explanation that the skill is region-specific, which matches the locale-policy violation criteria.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The natural-language instructions and usage guidance are exclusively in Chinese, which can amount to a language policy violation when no user opt-in or alternative language path is provided. The file does not indicate that the skill is intentionally restricted to a Chinese-language audience or region-specific context.

Static analysis

No suspicious patterns detected.