Back to skill

Security audit

Phylo Tree

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent phylogenetic-analysis tool, but unsafe R code construction and under-disclosed Feishu uploads make it require careful review before use.

Install only after reviewing or fixing the Rscript path interpolation issue, and run the workflow as an unprivileged user with simple trusted output paths. Treat Feishu publishing as a separate opt-in action: confirm the lark-cli bot destination and the exact report and figure files before upload. Back up ~/.condarc before following the install guide and prefer pinned dependency files where possible.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_v2.py:445
Finding

Arbitrary R Code Execution Through User-Controlled Output Paths

Content
View full analysis
None: """ Root tree at midpoint and ladderize for better visualization Args: input_tree: Input tree file (Newick format) output_tree: Output rooted tree file """ print_info("Rooting tree at midpoint and ladderizing") r_script = f""" library(ape) # Read tree tree <- read.tree("{input_tree}") # Midpoint rooting tree_rooted <- midpoint(tree) # Ladderize tree_rooted <- ladderize(tree_rooted) # Save write.tree(tree_rooted, "{output_tree}") cat("✓ Tree rooted and ladderized\\n") """ try: subprocess.run(["Rscript", "-e", r_script], check=True, capture_output=True, text=True) print_success(f"Rooted tree: {output_tree}") except subprocess.CalledProcessError as e: print_error(f"Tree rooting failed: {e}") sys.exit(1) ``` The fallback visualization contains the same pattern: ```python def visualize_basic(tree_file: Path, output_dir: Path) -> None: """Basic tree visualization fallback""" r_script = f""" library(ape) tree <- read.tree("{tree_file}") # Circular tree pdf("{output_dir}/tree_circular.pdf", width=12, height=12) plot(tree, type="fan", cex=0.5, main="Phylogenetic Tree (Circular)") dev.off() # Rectangular tree pdf("{output_dir}/tree_rectangular.pdf", width=16, height=20) plot(tree, type="phylogram", cex=0.4, main="Phylogenetic Tree") dev.off() cat("✓ Basic figures generated\\n") """ subprocess.run(["Rscript", "-e", r_script], check=True) ``` The affected path components originate from command-line arguments: ```python parser.add_ ...[truncated 2680 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run.py:95
Finding

R Code Injection in the Legacy Pipeline Runner

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_feishu_report.py:55
Finding

Analysis Reports and Figures Can Be Uploaded to Feishu Without an Explicit Confirmation Gate

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
references/installation.md:60
Finding

Unpinned Conda, CRAN, and Bioconductor Dependencies Reduce Supply-Chain Integrity

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (35)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/run.py (reported line 117)May include surrounding context.

python
r_script = SCRIPTS / "visualize.R"
    if r_script.exists():
        env = os.environ.copy()
        env["TREE_FILE"] = str(tree_file)
        env["FIG_DIR"] = str(fig_dir)
        subprocess.run(["Rscript", str(r_script)], env=env, check=True)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/test.sh (reported line 36)May include surrounding context.

sh
kdir -p "$TEST_DIR"

echo "Test directory: $TEST_DIR"
echo ""

# ============================================================================
# Test 1: Environment Check
# ============================================================================

echo "Test 1: Checking environment..."

# Activate conda environment
source /root/miniconda3/etc/profile.d/conda.sh
conda activate r43

# Check tools
TOOLS=("iqtree" "mafft" "trimal" "cd-hit")
ALL_OK=true

for tool in "${TOOLS[@]}"; do
    if command -v $tool &> /dev/null; then
        echo -e "  ${GREEN}✓${NC} $tool found"
    else
        echo -e "  ${RED}✗${NC} $tool NOT found"
        ALL_OK=false
    fi
done

# Check R packages
echo "  Checking R packages..."
R --quiet --no-save -e '
packages <- c("ape", "ggtree", "ggplot2", "patchwork", "dplyr")
missing <- packages[!sapply(packages, requireNamespace, quietly=TRUE)]
if (length(missing) > 0) {
    cat("Missing R packages:", paste(missing, collapse=", "), "\n")
    quit(status=1)
} e

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown template is entirely written in Chinese, including headings and field labels, which implicitly constrains the generated report language. The file does not offer a user opt-in for language selection or document that the skill is intentionally region-specific, which conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

These instructions modify the user's persistent Conda configuration file (~/.condarc) to change the solver backend, but they do not prominently warn that this affects all future Conda operations for the user. Persistent config edits can break existing workflows, mask root-cause issues, or cause unexpected behavior in unrelated environments, especially when applied via copy-pasted shell commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The one-click installer performs multiple persistent changes and package installations, including editing ~/.condarc, creating environments, and installing packages from external channels, but it presents this as a convenience script without a strong warning about system and account impact. One-step scripts increase the risk of users running them without understanding what will change, which can lead to configuration drift, package conflicts, and trust issues around remote package sources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Appending mirror channel settings directly to ~/.condarc can create duplicate, conflicting, or reordered channels that affect package resolution for all future Conda commands. Because the instructions do not warn about this persistent impact or advise checking for existing channel configuration, users may unintentionally alter trust boundaries and package provenance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide instructs users to modify ~/.condarc, which is a persistent global Conda configuration file, without warning that this change affects future Conda behavior outside this project. Altering the solver globally can change package resolution for unrelated environments and may break or degrade other workflows, making this a real safety and integrity issue even if not overtly malicious.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/installation_quick.md (reported line 20)May include surrounding context.

sed -i 's/solver: libmamba/solver: classic/' ~/.condarc

text

### Step 2: Create environment
```bash
conda create -n r43 python=3.14 -y
conda activate r43

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file is natural-language guidance for AI use, and it consistently forces a single language/locale throughout the template and usage instructions. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific; neither is present here.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate_feishu_report.py (reported line 69)May include surrounding context.

python
"--as", "bot"
    ]
    
    result = subprocess.run(cmd, capture_output=True, text=True)
    if result.returncode != 0:
        print(f"✗ Failed to create Feishu document: {result.stderr}")
        return None

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate_feishu_report.py (reported line 91)May include surrounding context.

python
"--as", "bot"
    ]
    
    result = subprocess.run(cmd, capture_output=True, text=True)
    if result.returncode != 0:
        print(f"✗ Failed to create Feishu document: {result.stderr}")
        return None

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script uploads generated report content to Feishu through an external CLI without an explicit confirmation step or clear disclosure that local project data will leave the environment. In a research workflow, reports may contain unpublished results, metadata, or sensitive project details, so silent exfiltration to a third-party platform creates a real confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script automatically uploads local figure files to Feishu without explicit user acknowledgment that images from the project directory are being transmitted externally. Figures often embed sensitive labels, unpublished results, or sample identifiers, so automatic external transfer increases the chance of unintended disclosure.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate_feishu_report.py (reported line 116)May include surrounding context.

python
"--as", "bot"
        ]
        
        result = subprocess.run(cmd, capture_output=True, text=True, cwd=figures_dir.parent)
        if result.returncode != 0:
            print(f"    ✗ Failed: {result.stderr}")
        else:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated report contains authoritative claims about data provenance, filtering thresholds, tools, parameters, and results that are hard-coded rather than derived from verified project inputs. This can misrepresent scientific work, leak false compliance signals, and cause users to publish incorrect methods or conclusions under the appearance of automation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file contains user-facing natural language that is partly fixed to Chinese in the module usage/header and later report/output content, while the CLI description is in English. Because the skill does not offer the user a language or locale option, it can force a specific language experience without opt-in, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run.py (reported line 83)May include surrounding context.

python
"""Step 2: MSA + Tree"""
    print("\n[2] Multiple Sequence Alignment (MAFFT)")
    aligned = project_dir / "alignment" / "aligned.fasta"
    subprocess.run([
        "mafft", "--auto", "--thread", str(os.cpu_count() or 4),
        str(fasta_file)
    ], stdout=open(aligned, "w"), stderr=subprocess.PIPE, check=True)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run.py (reported line 92)May include surrounding context.

python
print("\n[3] Phylogenetic Tree (FastTree)")
    tree_file = project_dir / "trees" / "tree.nwk"
    log_file = project_dir / "logs" / "fasttree.log"
    subprocess.run([
        "fasttree", "-gamma", str(aligned)
    ], stdout=open(tree_file, "w"), stderr=open(log_file, "w"), check=True)
    print(f"    Tree: {tree_file}")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
94% confidence
Finding

This code builds inline R code with Python f-strings and interpolates filesystem paths directly into quoted R string literals. If an attacker controls the output directory or related path components and includes quotes or R syntax, they could break out of the string and inject arbitrary R code executed by Rscript.

Content

Scanner excerpt · scripts/run.py (reported line 99)May include surrounding context.

python
# Root the tree
    print("\n[3b] Rooting tree (R/ape)")
    subprocess.run([
        "Rscript", "-e", f'''
        library(ape)
        t <- midpoint(read.tree("{tree_file}"))

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run.py (reported line 120)May include surrounding context.

python
env = os.environ.copy()
        env["TREE_FILE"] = str(tree_file)
        env["FIG_DIR"] = str(fig_dir)
        subprocess.run(["Rscript", str(r_script)], env=env, check=True)
    else:
        # Inline minimal visualization
        subprocess.run([

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
94% confidence
Finding

This inline Rscript -e command interpolates tree_file and fig_dir directly into R source code. A crafted path containing quotes or R metacharacters could terminate the intended string literal and inject arbitrary R expressions, resulting in code execution in the R subprocess.

Content

Scanner excerpt · scripts/run.py (reported line 123)May include surrounding context.

python
subprocess.run(["Rscript", str(r_script)], env=env, check=True)
    else:
        # Inline minimal visualization
        subprocess.run([
            "Rscript", "-e", f'''
            library(ape)
            tree <- read.tree("{tree_file}")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The stats-gathering Rscript call again constructs executable R code with direct interpolation of a path derived from the output directory. An attacker who controls that path may inject additional R commands, leading to arbitrary code execution during report generation.

Content

Scanner excerpt · scripts/run.py (reported line 145)May include surrounding context.

python
report = project_dir / "REPORT.md"
    
    # Get tree stats
    stats = subprocess.run([
        "Rscript", "-e", f'''
        library(ape)
        t <- read.tree("{project_dir / "trees" / "tree_rooted.nwk"}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The report written to REPORT.md uses Chinese-only headings and labels such as 系统发育树分析报告, 查询, 日期, 数据, and 输出文件. This is a user-visible locale constraint with no opt-in or documented justification, so it falls under the natural-language policy violation category.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run_v2.py (reported line 243)May include surrounding context.

python
try:
        with open(log_file, "w") as log:
            subprocess.run(cmd, stdout=log, stderr=subprocess.STDOUT, check=True)
        print_success(f"CD-HIT completed, log: {log_file}")
    except subprocess.CalledProcessError as e:
        print_error(f"CD-HIT failed: {e}")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run_v2.py (reported line 371)May include surrounding context.

python
try:
        with open(log_file, "w") as log:
            subprocess.run(cmd, stdout=log, stderr=subprocess.STDOUT, check=True)
        print_success(f"CD-HIT completed, log: {log_file}")
    except subprocess.CalledProcessError as e:
        print_error(f"CD-HIT failed: {e}")