Back to skill

Security audit

AutoMD-Viz

Security checks for vulnerabilities and agentic risk

Overview

This skill appears intended for molecular-visualization work, but its shell script can turn crafted file names or options into executable PyMOL or Python code.

Review before installing. Use this only with trusted input files, trusted filenames, and trusted option values, preferably inside an isolated environment. Avoid running it on untrusted projects until the script validates options and passes values to Python/PyMOL as data rather than generated code. Pin dependencies before use if reproducibility or supply-chain control matters.

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
automd-viz.sh:149
Finding

Command Injection Through Generated PyMOL and Python Commands

Content
View full analysis
"${OUTPUT_DIR}/pymol_script.pml" << EOF # PyMOL Publication-Quality Rendering Script load ${structure}, protein hide everything show ${style} color ${color} # High-quality rendering settings set ray_trace_mode, 1 set ray_shadows, 1 set ray_trace_fog, 0 set antialias, 2 set ambient, 0.4 set specular, 0.5 set shininess, 10 set depth_cue, 0 set ray_opaque_background, 1 # View optimization orient zoom # Output ray ${OUTPUT_DPI}, ${OUTPUT_DPI} png ${output}, dpi=${OUTPUT_DPI} quit EOF if command -v pymol &>/dev/null; then pymol -c "${OUTPUT_DIR}/pymol_script.pml" || error "PyMOL execution failed" else python3 -c "import pymol; pymol.cmd.do('run ${OUTPUT_DIR}/pymol_script.pml')" || error "PyMOL execution failed" fi ``` The affected values originate from command-line arguments or environment variables: ```bash OUTPUT_DIR="${OUTPUT_DIR:-publication-viz}" OUTPUT_DPI="${OUTPUT_DPI:-300}" STRUCTURE_STYLE="${STRUCTURE_STYLE:-cartoon}" STRUCTURE_COLOR="${STRUCTURE_COLOR:-spectrum}" ``` ```bash --structure) INPUT_STRUCTURE="$2"; shift 2 ;; --style) STRUCTURE_STYLE="$2"; shift 2 ;; --color) STRUCTURE_COLOR="$2"; shift 2 ;; -o) OUTPUT_DIR="$2"; shift 2 ;; --dpi) OUTPUT_DPI="$2"; shift 2 ;; ``` ### Technical Analysis The script directly interpolates the structure path, rendering style, color, output path, and DPI into a generated PyMOL command file. These values are not escaped and are not restricted to safe character sets or documented allowlists. A value containing a newline or other PyMOL command-language delimiters can change the generated script's command structure and append unintended PyMOL commands. The risk is particularly significant because PyMOL scripting can invoke Python functionality and interac ...[truncated 1951 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
automd-viz.sh:232
Finding

Arbitrary Python Code Injection Through Inline Heredoc Interpolation

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
_meta.json:31
Finding

Unpinned Third-Party Dependencies Permit Non-Reproducible Supply-Chain Resolution

Content
View full analysis
=3.7", "numpy": "*", "matplotlib": "*", "seaborn": "*" }, "optionalDependencies": { "pymol": "*", "scikit-learn": "*", "umap-learn": "*", "MDAnalysis": "*" } ``` The documentation instructs users to install mutable package versions without integrity verification: ```bash pip install numpy matplotlib seaborn scikit-learn umap-learn MDAnalysis ``` ```bash pip3 install matplotlib seaborn numpy scipy pandas ``` ### Technical Analysis Wildcard dependency declarations and unversioned `pip install` commands cause installation results to depend on the packages available from the user's configured index at installation time. The package names observed in the project are not demonstrated to be typosquatted or intentionally malicious. The risk instead arises from unrestricted future resolution, compromised upstream releases, compromised package-index accounts, malicious mirrors, dependency confusion in customized environments, and unexpected breaking changes. No lock file, reviewed version set, package hashes, or trusted index configuration is provided. Consequently, two installations performed at different times may execute different third-party code even though the audited skill files remain unchanged. ### Attack Path 1. A user follows the documented installation instructions or a platform resolves wildcard dependencies from `_meta.json`. 2. The package installer queries the user's configured package index or mirror. 3. A compromised, replaced, or otherwise unreviewed package version is selected because no version or hash constraint prevents it. 4. Package-c ...[truncated 1120 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The inline help documents --pymol-script FILE as a supported structure option, implying users can supply a custom PyMOL script. However, the argument parser never handles --pymol-script, and pymol_structure_viz() always generates and runs its own script instead, so the documentation contradicts the implemented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill file is written in Chinese, including the title, troubleshooting steps, and user-facing guidance, with no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

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 · publication-viz-errors.md (reported line 23)May include surrounding context.

md
conda install -c conda-forge pymol-open-source

# Ubuntu/Debian
sudo apt-get install pymol

# macOS
brew install pymol

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This is a markdown file, so SQP-2 applies to omissions in user-facing safety disclosures. The report-generation section explicitly states that the tool creates a figures/ directory and VISUALIZATION_REPORT.md, but it does not mention any overwrite or filesystem-impact warning for existing files in the working directory.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This shell skill contains user-facing descriptions, help text, logs, and errors primarily in Chinese, with some English labels, but does not indicate any language-selection or opt-in mechanism. Under the policy rule for language/locale constraints, hardcoded user-facing language can be a policy concern when no choice is offered.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The usage text claims a --layout GRID plotting option exists, suggesting plot layout customization is supported. In the implementation, PLOT_LAYOUT is never parsed from CLI and is never used by python_plot() or elsewhere, so the documented capability is not actually present.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The comment presents trajectory_viz() as implementing PCA/t-SNE/UMAP visualization. In practice, it simply loads projection_${method}.xvg and, on failure, tells the user to run PCA first, indicating the function does not itself perform those analyses and is partly PCA-specific despite broader documentation.

Content

No source excerpt is available for this finding.