Back to skill

Security audit

Motif Logo Generator

Security checks for vulnerabilities and agentic risk

Overview

This skill is related to motif logos, but it overstates what it produces and can emit unsafe shell commands from user-supplied sequence data.

Review this skill before installing. Use it only in an isolated workspace with trusted sequence files, do not blindly execute the generated WebLogo command text, and prefer fixing the implementation to validate sequence characters, write FASTA files directly, safely invoke WebLogo without a shell, and pin dependencies.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.py:82
Finding

Shell Command Injection Through Generated WebLogo Instructions

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 82-106
Vulnerability Type: Shell command injection through untrusted heredoc content and unquoted command arguments
Risk Level: Medium

Vulnerable Code

python
def generate_weblogo_commands(self, sequences, output_file="motif_logo.png"):
    """Generate WebLogo command line instructions."""
    # Save sequences to FASTA format
    fasta_content = []
    for i, seq in enumerate(sequences):
        fasta_content.append(f">seq{i+1}")
        fasta_content.append(seq)
    
    newline = '\n'
    commands = f"""# Motif Logo Generation Commands
# Using WebLogo (https://weblogo.berkeley.edu/)

# Step 1: Save sequences to FASTA file
cat > sequences.fa << 'EOF'
{newline.join(fasta_content)}
EOF

# Step 2: Convert to alignment format (if needed)
# Step 3: Generate logo using WebLogo
weblogo -f sequences.fa -o {output_file} -F png \
    --title "Sequence Motif" \
    --color-scheme chemistry \
    --resolution 300

# Alternative: Use seq2logo
# seq2logo -f sequences.fa -o {output_file}
"""
    return commands

Technical Analysis

Sequence values are inserted verbatim into a shell heredoc whose fixed delimiter is EOF. An attacker-controlled sequence line containing exactly EOF can terminate the heredoc early. Subsequent sequence lines then become shell commands when the generated instructions are copied into or executed by a shell.

The reusable method also inserts output_file directly into two command lines without shell quoting. Although the current CLI calls the method without forwarding the CLI output path and therefore uses the fixed default, another caller can pass shell metacharacters through this public method argument.

The script only prints or saves these instructions and does not execute them automatically. Exploitation therefore requires a user, agent, or downstream automation process to execute ...[truncated 1508 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not generate executable shell scripts from untrusted sequence data.
  2. Write the FASTA file directly through Python file APIs rather than embedding sequence data in a heredoc.
  3. Invoke WebLogo with an argument array and shell=False, for example with subprocess.run, so shell metacharacters are not interpreted.
  4. Validate sequences against the expected DNA or protein alphabet and reject control characters, embedded newlines, and malformed records.
  5. Validate output paths separately and enforce an approved output extension and destination directory where appropriate.
  6. If shell instructions must be generated, use a randomized delimiter that cannot occur in the content and quote every command argument with shlex.quote(). Direct execution without a shell remains preferable.
  7. Add regression tests using EOF, command separators, command substitutions, whitespace, and newline-containing values.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned NumPy Dependency Weakens Supply-Chain Integrity

Content
View full analysis

Vulnerability Details

File Location: requirements.txt, line 1
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

Vulnerable Code

text
numpy

Technical Analysis

The dependency declaration does not constrain NumPy to a reviewed version and does not provide an artifact hash. Each installation can therefore resolve to a different release from the configured package index.

This prevents deterministic dependency resolution and means that a newly published, compromised, or incompatible upstream release could be installed without a corresponding change to the project. No evidence was found that this project intentionally references a malicious package, uses a misspelled package name, or configures an untrusted package source; the finding concerns missing version and artifact integrity controls.

Attack Path

  1. A user follows the documented installation process and runs pip install -r requirements.txt.
  2. The package installer queries its configured index for a NumPy release.
  3. Because no version or hash is specified, the installer selects whichever compatible release is available under the active resolver policy.
  4. If the selected distribution or configured index has been compromised, malicious installation or runtime code could execute in the installation environment.

Impact Assessment

A compromised dependency could execute with the privileges of the account performing installation or running the application. Potential scope includes the active Python environment and files, credentials, or network resources accessible to that account.

This is a supply-chain hardening weakness rather than evidence of an existing malicious dependency. The practical risk is reduced when installation is performed from a trusted index in an isolated, least-privileged environment.

Remediation
View remediation

Remediation Suggestions

  1. Pin NumPy to a reviewed version or narrowly bounded compatible range.
  2. Generate a lock file containing hashes for the exact distributions used by supported platforms.
  3. Install with hash verification, such as pip install --require-hashes -r requirements.txt.
  4. Retrieve packages only from explicitly trusted indexes and avoid unnecessary extra indexes.
  5. Use automated dependency vulnerability scanning and review updates before regenerating the lock file.
  6. Perform dependency installation in an isolated virtual environment or container under a least-privileged account.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (4)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description claims the skill generates publication-quality sequence logos for DNA or protein motifs. The supplied code only generates a text-based ASCII logo and separately prints example shell commands for an external tool (WebLogo) that could create a PNG. It does not itself create graphical, publication-quality logos. While the overall domain (motif/logo generation) is related, the implemented primary behavior is materially more limited than declared. There are no suspicious undeclared permissions or unrelated behaviors, but the core capability is overstated, so this is a mismatch.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation explicitly instructs running a local Python script that reads input files and writes output artifacts, but it declares no explicit tool scope such as permissions or allowed-tools. That omission weakens containment and reviewability because an agent may execute file-writing behavior without a formally bounded capability declaration, increasing the risk of unintended writes or misuse if the script behavior changes.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency list specifies 'numpy' without a version constraint, making builds non-reproducible and allowing different environments to resolve to different releases. This can unexpectedly introduce vulnerable, incompatible, or maliciously substituted package versions through normal dependency resolution or supply-chain compromise.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
numpy

Unverifiable Dependency: numpy has 16 known advisory(ies) (CVE-2014-1859 (Numpy arbitrary file write via symlink attack); CVE-2021-41495 (NumPy NULL Pointer Dereference); CVE-2021-33430 (NumPy Buffer Overflow (Disputed)) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Because numpy is unpinned, it is impossible to verify whether installation will select a release affected by one of several known advisories. The risk is supply-chain uncertainty rather than proof of direct exploitation in this file, but it still weakens security assurance and can expose downstream users to known flaws depending on resolution time and environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.