Back to skill

Security audit

Genos基因序列分析

Security checks for vulnerabilities and agentic risk

Overview

This DNA analysis skill is purpose-aligned, but needs Review because it can execute unverified downloaded model code and handles Hugging Face tokens without strong safeguards.

Install only if you are comfortable running third-party ML model code locally. Prefer a clean virtual environment or container, verify model artifacts yourself, avoid entering broad or long-lived Hugging Face tokens into install.sh, and do not run the installer or model as an administrator/root user.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
install.sh:128
Finding

Unverified Model Archive Can Execute Remote Repository Code

Content
View full analysis
/dev/null && command -v unzip &> /dev/null; then curl -L -o genos-1.2b.zip "https://github.com/zhejianglab/Genos/releases/download/v1.0/Genos-1___2B.zip" unzip -o genos-1.2b.zip -d ./models/Genos-1___2B rm -f genos-1.2b.zip echo "✓ 模型已从 GitHub Releases 下载" ``` `scripts/genos_dna.py:78-89`: ```python def load_model(): """加载 Genos 模型""" global _model, _tokenizer if _model is None: print("Loading Genos model...", file=sys.stderr) _tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True, local_files_only=True) _model = AutoModelForCausalLM.from_pretrained( model_path, torch_dtype=torch.float16, device_map="cpu", trust_remote_code=True, local_files_only=True ) ``` ### Technical Analysis The optional installer follows HTTP redirects, downloads a mutable release archive, and extracts it without validating a cryptographic checksum, signature, immutable revision, expected file list, or final download origin. The runtime subsequently loads that model with `trust_remote_code=True`. This Transformers option permits custom Python modules contained in the model repository to execute in the current Python process. Although `local_files_only=True` prevents model retrieval during the loading operation, it does not establish the integrity or safety of files previously downloaded by the installer. This creates a direct trust chain from an externally controlled release asset to local Python code execution. The GitHub URL appears consistent with the declared Genos organization, so the presence of the download is not by itself evidence of malicious ...[truncated 1959 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned and Unhashed Dependencies Allow Mutable Supply-Chain Code

Content
View full analysis
=2.0.0 transformers>=4.35.0 tokenizers>=0.15.0 numpy>=1.24.0 ``` `install.sh:44-46`: ```bash echo "安装依赖..." pip install --upgrade pip pip install -r requirements.txt ``` `install.sh:115-117`: ```bash if command -v pip3 &> /dev/null; then pip3 install modelscope python3 -c "from modelscope import snapshot_download; snapshot_download('zhejianglab/Genos-1___2B', cache_dir='./models')" ``` ### Technical Analysis All primary dependencies use open-ended minimum-version constraints. The installer also upgrades `pip` and installs `modelscope` without pinning a reviewed version. No lock file, package hashes, signed package policy, or controlled package index is provided. As a result, two installations performed at different times may retrieve and execute different package versions. Python package installation can execute build-backend or setup logic, and imported dependencies execute code within the application process. A future compromised, malicious, or simply incompatible release would therefore enter the environment without any project change being reviewed. This is a supply-chain weakness rather than evidence that the named packages are currently malicious. ### Attack Path 1. A dependency release channel or maintainer account is compromised, or an unsafe future version is published. 2. A user runs `install.sh`. 3. `pip` resolves the newest package versions satisfying the open-ended `>=` constraints. 4. The malicious or compromised distribution is downloaded without comparison against a project-approved hash. 5. Package build or installation hooks execute during installation, or malicious code executes later when the dependency is imported. 6. The payload operates with the p ...[truncated 678 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
install.sh:94
Finding

Hugging Face Token Is Echoed and Exposed Through Process Arguments

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (26)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file presents the skill documentation entirely in Chinese, including setup and usage instructions, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The primary title and the entire skill documentation are presented in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Per the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The README instructs users to download and unzip a model archive directly from an external URL without integrity verification. In the broader skill context, this is more dangerous because the same README explicitly notes use of transformers with trust_remote_code=True, meaning a tampered or malicious model package could lead to arbitrary code execution when loaded.

Content

Scanner excerpt · README.md (reported line 98)May include surrounding context.

https://github.com/zhejianglab/Genos

或使用命令行下载

curl -L -o genos-1.2b.zip https://github.com/zhejianglab/Genos/releases/download/v1.0/Genos-1___2B.zip unzip genos-1.2b.zip -d ./models/Genos-1___2B

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation directs the agent to read environment variables, read and write files, and execute shell/Python commands, but the manifest declares no corresponding tool scope or permission boundaries. This creates an implicit capability expansion where a seemingly simple DNA-analysis skill can perform host-side actions without transparent authorization, increasing the risk of unintended command execution or filesystem modification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

L003 将触发条件描述为“当用户提到 DNA、基因、基因组、碱基序列、ACGT 等生物信息学相关问题时使用此技能”,范围覆盖了非常广泛的普通讨论场景,缺少明确的边界条件。文档也没有提供排除条件或负例来说明何时不应调用该技能,因此容易在仅仅讨论生物学概念而非请求序列分析时被误触发。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to execute a shell command that runs inline Python, mutates import paths, imports local code, loads a model, and writes a state file before performing DNA analysis. Embedding executable startup procedures in documentation is dangerous because an agent may follow them automatically, enabling arbitrary local code execution from repository-controlled files such as './scripts/genos_dna.py'.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file uses Chinese for the title, docstrings, status messages, and CLI usage text throughout, which imposes a specific language on users. The file does not offer any language selection, opt-in, or explanation that the tool is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

All user-facing prompts, status messages, and instructions in the script are written in Chinese, with no option for another language and no indication that the skill is intentionally limited to a Chinese-speaking audience. This creates a language/locale policy concern because the script imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

Manifest 将该技能描述为使用 Genos 模型进行 DNA 序列分析,但此安装脚本还会提示输入 Hugging Face Token、执行 huggingface-cli 登录,并从 Hugging Face、ModelScope 或 GitHub 下载资源。这些是安装/分发层面的外部网络与认证操作,不是对“DNA 序列分析”能力本身的直接实现。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

脚本通过交互方式收集 Hugging Face Token 并立即用于 huggingface-cli login,但未说明凭证会如何存储、作用范围是什么、是否会持久化到本机配置。令牌收集对安装私有模型可能有正当用途,但当前实现缺乏最基本的凭证处理告知,容易导致用户在不知情下暴露长期有效访问令牌。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

脚本请求敏感的 Hugging Face 访问令牌,却没有任何用户可见的安全提示来说明令牌可能被 huggingface-cli login 持久化保存到本地配置,或后续被其他进程复用。这种不透明的凭证处理会增加令牌泄露、误共享或在多用户系统上被滥用的风险。

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · install.sh (reported line 128)May include surrounding context.

sh
echo "从 GitHub Releases 下载 Genos 模型..."
            echo "注意: 模型较大(约 2GB),下载可能需要一些时间"
            
            if command -v curl &> /dev/null && command -v unzip &> /dev/null; then
                curl -L -o genos-1.2b.zip "https://github.com/zhejianglab/Genos/releases/download/v1.0/Genos-1___2B.zip"
                unzip -o genos-1.2b.zip -d ./models/Genos-1___2B
                rm -f genos-1.2b.zip

Tainted flow: 'model_status_file' from os.environ.get (line 45, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
94% confidence
Finding

The script allows the path for the status file to be controlled by the GENOS_STATUS_FILE environment variable or config.json, and then writes to that path without validation. In environments where untrusted parties can influence configuration or environment variables, this can cause arbitrary file overwrite within the privileges of the running process, which is a real filesystem integrity issue.

Content

Scanner excerpt · scripts/genos_dna.py (reported line 72)May include surrounding context.

python
model_status_dir = os.path.dirname(model_status_file)
    if model_status_dir and not os.path.exists(model_status_dir):
        os.makedirs(model_status_dir, exist_ok=True)
    with open(model_status_file, 'w') as f:
        f.write('loaded')

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest and module documentation state that the skill uses the Genos model for DNA sequence analysis, but analyze_dna_sequence merely cleans the input and calculates length, GC content, and base composition. Although load_model() is called, the loaded model is never used to produce the returned analysis, creating a semantic mismatch between the claimed Genos-based analysis and the actual implementation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

extract_sequence_features loads the model and tokenizer but does not use them for feature extraction. Instead, it returns manually computed composition metrics and static model_info, which makes the behavior inconsistent with the documented purpose of using the Genos model for sequence analysis.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill adds persistent filesystem state management via a '.model_loaded' file, which is outside the core need of answering DNA-sequence-analysis requests. This encourages the agent to read and write local state in the project directory, creating opportunities for unintended file manipulation, state spoofing, or behavior that depends on attacker-controlled filesystem artifacts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation says model state is recorded in ./scripts/.model_loaded, but the startup code writes ./.model_loaded, and the automation steps also tell the agent to check ./.model_loaded. This is an active contradiction in the instructions that can cause the agent to check one path and write another.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower-bound range instead of an exact pinned version, which makes builds non-reproducible and can silently pull in vulnerable or incompatible releases over time. In a security-sensitive environment, this weakens supply-chain control and makes it difficult to verify whether known advisories affect the deployed package.

Content

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

text
torch>=2.0.0
transformers>=4.35.0
tokenizers>=0.15.0
numpy>=1.24.0

Unverifiable Dependency: torch has 16 known advisory(ies) (CVE-2025-2953 (PyTorch susceptible to local Denial of Service); CVE-2022-45907 (PyTorch vulnerable to arbitrary code execution); CVE-2025-32434 (PyTorch: `torch.load` with `weights_only=True` leads to remote code execution) +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
94% confidence
Finding

Torch has multiple known advisories, including severe issues such as code execution and denial of service, but the manifest does not specify which version will be installed. That makes it impossible to determine whether the environment is exposed, and in an ML skill this matters because PyTorch is frequently used with serialized model artifacts and complex native code.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Using an unpinned transformers dependency allows different installations to resolve to different versions, including versions later found vulnerable. Because this package often handles model loading and parsing of untrusted artifacts, version drift can meaningfully increase supply-chain risk.

Content

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

text
torch>=2.0.0
transformers>=4.35.0
tokenizers>=0.15.0
numpy>=1.24.0

Unverifiable Dependency: transformers has 16 known advisory(ies) (CVE-2023-2800 (transformers has Insecure Temporary File); CVE-2026-4372 (HuggingFace transformers vulnerable to remote code execution); CVE-2025-3933 (Transformers is vulnerable to ReDoS attack through its DonutProcessor class) +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
95% confidence
Finding

Transformers has numerous published advisories, including high-risk issues affecting model and file handling, and the unpinned requirement prevents verification that a safe version will be installed. This is particularly relevant for a genomics analysis skill because it likely depends on model-loading workflows where parser or deserialization flaws can be exposed.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

An unpinned tokenizers package creates non-deterministic builds and weakens assurance that the deployed version has been tested and approved. Even if no specific advisory is cited here, the lack of pinning is still a supply-chain hygiene issue that can expose the environment to future vulnerable releases.

Content

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

text
torch>=2.0.0
transformers>=4.35.0
tokenizers>=0.15.0
numpy>=1.24.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The numpy requirement is not pinned, so installations may resolve to varying versions over time, complicating vulnerability management and reproducibility. This becomes more concerning when the manifest is the only control point for dependency integrity.

Content

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

text
torch>=2.0.0
transformers>=4.35.0
tokenizers>=0.15.0
numpy>=1.24.0

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
90% confidence
Finding

Numpy has known advisories, and because the dependency is not pinned, there is no reliable way to verify whether the installed version includes relevant fixes. While numpy is generally lower-risk than model-loading frameworks in this context, unverifiable version selection still increases supply-chain uncertainty.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.