Back to skill

Security audit

MoA Explainer

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its stated purpose, but it can overwrite arbitrary writable files and lacks medical-review safeguards for patient-facing drug explanations.

Review this skill before installing or using it. Run it only in a sandbox or disposable workspace, avoid passing important existing file paths to --output, and treat all medical explanations as draft educational copy requiring qualified clinical or pharmacology review before sharing with patients, investors, or healthcare audiences.

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/main.py:112
Finding

Unrestricted User-Controlled Output File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 112–114
Vulnerability Type: Arbitrary file write and overwrite through an unvalidated output path
Risk Level: Medium

Vulnerable Code

python
if args.output:
    with open(args.output, 'w') as f:
        f.write(text)

Technical Analysis

The --output command-line argument is passed directly to Python's open() function in write mode without path normalization, workspace-boundary enforcement, symlink checks, or overwrite protection.

Because mode 'w' creates a missing file and truncates an existing file, anyone able to invoke the skill can select any path writable by the process. Relative traversal paths such as ../../target and unrestricted absolute paths are accepted. This behavior conflicts with the package's documented security requirements to reject ../ traversal and restrict output to the workspace.

The issue does not independently elevate operating-system privileges: file access remains limited to the permissions of the account running the script.

Attack Path

  1. The attacker identifies a file writable by the skill process.
  2. The attacker invokes the script with the required parameters and supplies that file through --output, for example:
bash
python scripts/main.py \
  --drug example \
  --mechanism "blocks target activity" \
  --target receptor \
  --output ../../target-file
  1. The script accepts the path without validation.
  2. open(args.output, 'w') resolves the traversal path and truncates or creates the selected file.
  3. The generated explanation or animation script is written into that file.

A symlink placed within an otherwise expected output directory could similarly redirect the write unless symlink handling is explicitly enforced.

Impact Assessment

Successful exploitation permits creation or destructive overwrite of files accessible to the process account. Potential consequences include:

  • Corruption of project source ...[truncated 496 chars]
Remediation
View remediation

Remediation Suggestions

  1. Define a dedicated, trusted output directory rather than accepting unrestricted destinations.
  2. Resolve both the approved directory and requested destination to canonical absolute paths, then verify that the destination remains beneath the approved directory:
python
from pathlib import Path

output_root = Path("outputs").resolve()
output_root.mkdir(parents=True, exist_ok=True)

requested = (output_root / args.output).resolve()
if requested == output_root or output_root not in requested.parents:
    parser.error("Output path must remain within the approved output directory")
  1. Accept a filename or workspace-relative path only; reject absolute paths and explicit traversal components.
  2. Prevent symlink redirection by checking every relevant path component and using operating-system facilities such as O_NOFOLLOW where available.
  3. Avoid unintended replacement by using exclusive creation mode ('x') when overwriting is unnecessary.
  4. If replacement is required, write to a securely created temporary file in the same approved directory and atomically replace the destination after validation.
  5. Apply restrictive file permissions and execute the skill under a least-privileged account.
  6. Add automated tests covering absolute paths, ../ traversal, nested traversal, pre-existing files, and symlink destinations.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises executable Python workflows and workspace file writes, but it does not declare an explicit tool/permission scope such as allowed tools or file access boundaries. That creates an authorization ambiguity where an agent or reviewer may not have a clear, enforceable limit on what filesystem actions the skill is expected to perform, increasing the chance of unintended writes or broader-than-necessary execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is intended to generate drug mechanism explanations and explicitly lists patient education as a use case, yet the documentation does not require medical review, clinical accuracy checks, or a warning against using outputs as medical advice. In a patient-facing or healthcare-adjacent context, plausible but inaccurate explanations could mislead users, propagate unsafe medical claims, or be repurposed as authoritative content without expert validation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest and module docstring describe generating '3D animation scripts,' which suggests output tailored for a 3D animation system or engine. In practice, the code only concatenates human-readable scene descriptions into plain text, so the implemented behavior is materially narrower than the stated capability.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

The stated purpose is to explain drug mechanisms, and the CLI separately collects a molecular target, implying target-aware output. However, generate_lay_explanation ignores the provided target entirely and substitutes mechanism.split()[0], which can misrepresent what the explanation is actually based on.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.