Back to skill

Security audit

Biomed Dataset Finder

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims by searching biomedical dataset databases, with the main caution that optional CNGB tokens are entered on the command line.

Install only if you are comfortable with biomedical search terms being sent to NCBI, NGDC, and CNGB. Avoid supplying a CNGB token on the command line unless you understand that it may be visible in shell history, process lists, terminal logs, or job-runner metadata; using public-only search or skipping CNGB is safer when authenticated access is unnecessary.

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
scripts/search_datasets.py:320
Finding

CNGB API Token Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/search_datasets.py, lines 320 and 341
Vulnerability Type: Sensitive credential exposure through process arguments and shell history
Risk Level: Medium

Vulnerable Code

python
parser.add_argument("--cngb-token", help="CNGB API token (optional)")
python
if not args.skip_cngb:
    all_results.extend(search_cngb(args, token=args.cngb_token))

The credential is subsequently placed in the authorization header:

python
headers = {}
if token:
    headers["Authorization"] = f"Bearer {token}"

try:
    req = urllib.request.Request(f"{base}/search/dataset?{params}", headers=headers)
    with urllib.request.urlopen(req, timeout=15) as resp:
        data = json.loads(resp.read())

Technical Analysis

Accepting an API token as a command-line argument exposes it outside the application's intended credential boundary. Depending on the operating system and environment, command-line arguments may be visible through process-listing and monitoring facilities. The complete invocation may also be retained in interactive shell history, terminal logs, job-runner metadata, or diagnostic records.

The script does not print the token, hardcode it, or send it to an unrelated host. It limits use of the credential to an HTTPS Authorization: Bearer header sent to the declared CNGB endpoint. Nevertheless, command-line transport is an insecure secret-input mechanism.

Attack Path

  1. A user invokes the tool with --cngb-token SECRET.
  2. The shell may persist the complete command in its history, or a local process-monitoring facility may capture the argument while the program runs.
  3. An attacker with access to that history, process metadata, terminal recording, or job logs obtains the token.
  4. The attacker submits the recovered bearer token to CNGB.
  5. The attacker gains whatever CNGB API access is authorized for that token, including possible access to controlled datasets.

This path requires ...[truncated 559 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove or deprecate --cngb-token as a direct secret-bearing argument.
  2. Prompt securely using getpass.getpass() when authenticated CNGB access is requested.
  3. Alternatively, integrate with an operating-system credential store or accept a path to a token file whose permissions are restricted to the current user.
  4. If automation requires an environment variable, document its exposure limitations and ensure CI systems mask it from logs; a credential store or protected file is preferable.
  5. Avoid including tokens in examples, diagnostics, exception messages, telemetry, or command logs.
  6. Clear in-memory references when practical after constructing the authenticated request.
  7. Rotate any token that has previously been supplied on a command line where shell history or process telemetry may have retained it.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (2)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill instructs use of external networked data sources (NCBI, NGDC, CNGB) but does not declare any explicit tool scope or allowed-tools permissions. That creates an authorization and governance gap: an agent runtime may permit broader network access than intended, making it harder to constrain outbound requests, review data flows, or enforce least privilege.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code prints user-facing result messages in Chinese only, including the no-results message and source heading, with no option for the user to select language or locale. That creates a natural-language policy concern because the skill imposes a specific language regardless of user preference or environment.

Content

No source excerpt is available for this finding.