Back to skill

Security audit

Protein QC Strict

Security checks for vulnerabilities and agentic risk

Overview

This skill runs a local protein-sequence QC workflow, but its documentation overstates some scientific validation steps and the shell script has correctness and path-handling weaknesses.

Install only if you are comfortable with a local bioinformatics workflow that creates output files and uses conda-installed tools. Treat the literature validation, motif verification, and coevolution claims as advisory or incomplete unless you independently validate them; use simple trusted output paths until the shell quoting issue is fixed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
protein_qc_workflow.sh:15
Finding

Unquoted User-Controlled Output Path Enables Unsafe Shell Expansion

Content
View full analysis

Vulnerability Details

File Location: protein_qc_workflow.sh, lines 15-16
Vulnerability Type: Improper quoting and option handling for a user-controlled filesystem path
Risk Level: Medium

Vulnerable Code

bash
OUTPUT_DIR=$2

if [ -z "$INPUT" ] || [ -z "$OUTPUT_DIR" ]; then
    echo "Usage: bash protein_qc_workflow.sh input.fasta output_dir"
    exit 1
fi

mkdir -p $OUTPUT_DIR
cd $OUTPUT_DIR

Technical Analysis

OUTPUT_DIR originates from the second command-line argument and is expanded without double quotes in both mkdir and cd. Unquoted shell expansion subjects the value to word splitting and pathname expansion.

Consequently:

  • Whitespace can turn one supplied path into multiple arguments.
  • Wildcard characters such as *, ?, and bracket expressions can resolve to existing filesystem entries.
  • A value beginning with a hyphen can be interpreted as an option by commands that accept options.
  • mkdir may create multiple unintended directories.
  • cd may enter an unintended directory if a wildcard resolves to a single directory, or fail when expansion produces multiple arguments.

This does not directly permit shell metacharacters embedded in the variable to execute as commands because the shell does not parse control operators again after parameter expansion. The practical risks are unintended filesystem operations, workflow redirection, and denial of service rather than arbitrary command execution.

Attack Path

  1. An attacker or untrusted caller controls the workflow's second argument.
  2. The caller passes a quoted value containing spaces, wildcard characters, or option-like text, for example:
    bash
    bash protein_qc_workflow.sh input.fasta 'results/*'
    
  3. Inside the script, the unquoted $OUTPUT_DIR is expanded again by the shell.
  4. If the wildcard matches filesystem entries, those entries become arguments to mkdir and cd.
  5. The wor ...[truncated 888 chars]
Remediation
View remediation

Remediation Suggestions

Quote every filesystem path and use an option terminator where supported:

bash
mkdir -p -- "$OUTPUT_DIR"
cd -- "$OUTPUT_DIR"

Apply additional hardening when the value can originate from an untrusted caller:

  1. Resolve the path before changing directories:
    bash
    OUTPUT_DIR=$(realpath -m -- "$2") || exit 1
    
  2. Enforce an approved parent directory if the workflow must operate within a controlled workspace.
  3. Reject paths outside that workspace after canonicalization.
  4. Check the directory transition explicitly:
    bash
    mkdir -p -- "$OUTPUT_DIR" &&
        cd -- "$OUTPUT_DIR" ||
        exit 1
    
  5. Quote all other variable expansions consistently to prevent similar defects during future modifications.
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill markets itself as a strict, publication-quality workflow with literature validation, family-specific validation, and coevolution analysis, but large parts of that behavior are only described narratively or are only partially implemented. This can mislead users into trusting scientific outputs that were not actually validated as claimed, creating integrity and reproducibility risks rather than direct code-execution risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest advertises conservation/coevolution analysis, but the provided coevolution code is not runnable because it depends on an undefined helper function. Users may believe they performed a scientifically meaningful analysis when the workflow cannot execute as written, undermining result validity.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest advertises conservation/coevolution analysis, but the provided coevolution code is not runnable because it depends on an undefined helper function. Users may believe they performed a scientifically meaningful analysis when the workflow cannot execute as written, undermining result validity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The section heading and all core operating principles are written as mandatory guidance in Chinese, and the document presents them as the skill's '核心原则' without indicating that users may choose another language. This creates a natural-language locale policy concern because the skill implicitly enforces a specific language for critical instructions without opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The motif verification step is described as a validation gate, but the code explicitly retains sequences that fail the motif check. In this context, that weakens the advertised QC barrier and can allow incorrect or off-family sequences to pass into downstream alignment and coevolution analyses.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a workflow that includes literature validation plus conservation and coevolution analysis. In the code, the implemented stages are length filtering, redundancy removal, complexity filtering, motif checking, MSA, trimming, and a quality report with gap ratio, sequence identity, coverage, and per-column conservation entropy; there is no literature lookup/validation step and no coevolution computation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Stage 4 is documented and announced as 'Motif verification', which implies the motif check affects QC selection. However, after computing with_motif, the script explicitly saves all input sequences unchanged (# Save all (variants may not have motif)), so the verification is informational only and does not enforce the stated stage behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This shell script creates an output directory, changes into it, and later writes several FASTA and log files, but it does not include any explicit warning comment or user-facing notice that it will modify the filesystem in this way. While the file names are printed at the end and the script's purpose implies output generation, the safety-disclosure criteria for code files call for some visible explanation before performing writes.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.