Back to skill

Security audit

ncbi-search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed NCBI search helper with normal network, API-key, file output, and local cache behavior for that purpose.

Before installing, use an isolated Python environment, prefer setting NCBI_API_KEY as an environment variable instead of passing it on the command line, and disable caching with NCBI_NO_CACHE=1 for sensitive biomedical searches. The cache and output-file features are disclosed, but they can leave query results on disk.

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)

T08 · Insecure Dependencies

Warning
Location
README.md:36
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
``` 2. Generate and record cryptographic hashes for the approved package and its transitive dependencies: ```text requests== \ --hash=sha256: ``` 3. Install dependencies with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Use an isolated virtual environment rather than modifying a shared or system Python installation: ```bash python -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.txt ``` 5. Add an automated dependency-update process that reviews security advisories and regenerates hashes only after the new versions have been tested and approved. 6. Update both the English and Chinese installation sections so they consistently use the locked dependency manifest. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/ncbi_search.py:487
Finding

NCBI API Key Exposed Through Command-Line Arguments

Content
View full analysis
Optional[str]: """Get NCBI API key from args or environment.""" if args.api_key: return args.api_key return os.environ.get("NCBI_API_KEY") ``` For NCBI requests, it is added to the HTTPS query parameters: ```python if api_key: params["api_key"] = api_key response_text = http_get( ESEARCH_URL, params=params, api_key=api_key, timeout=30, verbose=verbose ) ``` ### Technical Analysis Secrets passed as command-line arguments can be recorded in shell history and may be visible through process-inspection facilities, monitoring agents, diagnostic reports, or command auditing systems. This creates avoidable local exposure even though the subsequent network transmission is to the fixed official NCBI HTTPS endpoint. The network behavior itself is necessary for the declared functionality. The Skill sends the key only to `https://eutils.ncbi.nlm.nih.gov/entrez/eutils`, and no unauthorized recipient or credential-harvesting logic was found. Verbose mode prints the endpoint URL but does not directly print the parameter dictionary or API key. ### Attack Path 1. A user follows the documentation and runs the Skill with `--api-key `. 2. The complete command is retained i ...[truncated 1017 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · .gitignore (reported line 5)May include surrounding context.

text
*.pyc
*.pyo
.ncb_cache/
.env
.venv/
venv/
*.egg-info/

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises a broad NCBI multi-database search capability with automatic search-intent detection and routing. In contrast, this code chunk is specifically a PubMed fetch script: it accepts PMIDs directly, optionally reads them from a file, filters for numeric IDs, invokes helper functions named fetch_articles/get_api_key/format_output, and outputs fetched article details. That is materially narrower than the declared purpose. While it does align loosely with using NCBI/PubMed and returning formatted biomedical information, the primary purpose in the code is article retrieval by known PMID, not cross-database search. Therefore the description does not accurately represent this supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is a clear description/behavior mismatch. The declared purpose describes a multi-database NCBI E-Utilities search skill with automatic routing across many databases. The supplied code only interacts with PubMed endpoints and hardcodes the database parameter to "pubmed" in both search and fetch operations. Its extra logic is about PubMed query enhancement (MeSH, author/date/article-type parsing), not database selection. While it does use the NCBI E-Utilities API and returns formatted biomedical literature results, the broader claims about 10+ databases and automatic intent-based routing are not implemented in this code chunk.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'file_write' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
82% confidence
Finding

This utility performs outbound network requests via requests.Session().get() to external services, so undeclared network capability is a real permission/governance issue. In this skill's context, network access is expected for NCBI E-Utilities, which lowers suspicion of malicious intent, but missing declaration can still bypass least-privilege expectations and surprise users or hosting environments.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
82% confidence
Finding

This utility performs outbound network requests via requests.Session().get() to external services, so undeclared network capability is a real permission/governance issue. In this skill's context, network access is expected for NCBI E-Utilities, which lowers suspicion of malicious intent, but missing declaration can still bypass least-privilege expectations and surprise users or hosting environments.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'file_read' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README states that all API responses are automatically persisted to a local SQLite cache, but it does not clearly warn users that biomedical queries and returned records may contain sensitive research topics, identifiers, or potentially regulated data. In an agent-skill context, automatic background caching increases risk because users may not realize their prompts and fetched content are being retained on disk beyond the active session.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file title and body indicate the skill documentation is written in Chinese, but there is no opt-in, alternate language guidance, or justification for enforcing that locale. This can violate language/locale policy when users are not given a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Automatically persisting API responses to a local SQLite cache without a clear up-front warning can create unintended data retention. Biomedical search terms, returned records, and possibly API-associated metadata may be stored in the workspace and later exposed to other tools, users, or logs, making this more significant in agent environments with shared state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This script includes user-facing natural-language output in Chinese, such as the query explanation string at L199, and the CLI description/help text later in the file. Because the skill does not offer a language or locale option, it imposes a specific language on users without opt-in, which matches the locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The command-line description, examples, and argument help strings are written in Chinese only. This is a natural-language locale restriction without any user choice or documented justification, so it constitutes a policy violation under the language/locale rule.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a search skill that queries NCBI databases and returns formatted results, but this script also supports persisting output to an arbitrary local file via --output. Local file writing is not an obvious requirement of the stated remote-search purpose and expands behavior beyond simply returning results.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest presents the skill as a unified NCBI search tool that routes queries to appropriate databases and returns formatted results. The documentation additionally describes a PubMed-specific natural-language-to-query conversion tool and a separate batch PMID detail fetcher, which are adjacent but broader capabilities than the manifest explicitly claims.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description focuses on searching NCBI databases and returning formatted results, which makes network access expected. However, the documentation also states the skill can save results to files and persist all HTTP responses in a local SQLite cache under .ncbi_cache/cache.db, which is additional stateful behavior beyond the manifest's plain search description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

The stated purpose is searching public NCBI databases, and the manifest emphasizes the official free API rather than credential handling. Reading NCBI_API_KEY from the environment introduces credential access capability that is not mentioned in the declared scope of the skill.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.