Back to skill

Security audit

PaperBanana

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with generating academic diagrams, but it performs under-disclosed automatic network downloads and relies on broad local imports that users should review before installing.

Install only in a trusted project directory and expect outbound network use beyond the documented model-provider calls, including a HuggingFace dataset download. Use explicit input and output paths, avoid running it where untrusted files can exist in the parent directory, and review costs because the default generates 10 candidates in parallel.

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
run.py:24
Finding

Untrusted Parent Directory Precedence Enables Python Module Hijacking

Content
View full analysis

Vulnerability Details

File Location: run.py:24-25
Vulnerability Type: Python import-path manipulation and local module hijacking
Risk Level: Medium

Vulnerable Code

python
# Ensure project root is on sys.path
PROJECT_ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(PROJECT_ROOT))

Technical Analysis

The script calculates PROJECT_ROOT as the parent of the skill package directory and inserts that directory at index zero of sys.path. This gives modules located in the parent project directory precedence during subsequent imports.

The run() function later imports security-sensitive modules such as agents.planner_agent, agents.visualizer_agent, and utils.config. Because the added path is searched first, a malicious or unintended package with one of these names in the parent directory can execute code during import.

This is a local module-hijacking weakness rather than evidence that the reviewed package itself contains a malicious payload. Exploitation requires an attacker or another untrusted component to be able to create or replace modules in the parent project directory before this skill is invoked.

Attack Path

  1. An attacker obtains write access to the directory represented by Path(__file__).resolve().parent.parent, or influences content extracted or installed into that directory.
  2. The attacker creates a matching package or module, such as agents/planner_agent.py or utils/config.py.
  3. A user invokes run.py.
  4. Lines 24-25 place the attacker-influenced parent directory at the beginning of Python's module search path.
  5. When run() performs its late imports, Python resolves the attacker's module.
  6. Top-level code in that module executes with the same operating-system identity, environment variables, filesystem access, and network permissions as the skill process.

Impact Assessment

Successful exploitation permits arbitrary Python ...[truncated 521 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not prepend a broad parent directory to sys.path.
  • Package the required application modules as an installable Python distribution and use explicit package imports.
  • If path initialization is unavoidable, resolve and validate the expected repository root, restrict it to a trusted immutable location, and append it only when necessary rather than assigning it highest precedence.
  • Run the skill from a virtual environment containing pinned, trusted dependencies.
  • Ensure the repository root and all imported package directories are not writable by less-privileged or unrelated users.
  • Validate deployment archives so unexpected top-level agents, utils, or similarly named modules cannot be introduced.
  • Consider invoking the entry point as a package module, such as python -m trusted_package.run, to obtain deterministic package-relative import behavior.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents file input and output behavior (--content-file and --output) but does not declare any tool scope such as permissions or allowed-tools. In an agent ecosystem, undeclared file read/write capability weakens sandboxing and user visibility, increasing the risk that the skill can access or overwrite local files beyond what the caller expects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI silently performs a network download from HuggingFace when local benchmark data is missing, even though the advertised function is generating diagrams from user-supplied text. This expands the trust boundary, creates nondeterministic behavior, and can expose users to unwanted outbound network access or unreviewed remote content in environments that expect offline or minimally privileged execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Downloading benchmark data is not necessary for the core task of converting method text into a diagram, so this behavior is over-privileged relative to the skill's stated purpose. In security-sensitive environments, unjustified remote fetches can leak metadata, violate policy, consume resources, or introduce supply-chain risk through externally controlled artifacts.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.