Back to skill

Security audit

universal-pdf-vision-parser

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it sends chosen PDF page images to DashScope/Qwen and needs careful API-key handling.

Install only in a controlled Python environment, prefer DASHSCOPE_API_KEY or a secret manager instead of putting keys on the command line, avoid sending sensitive PDFs unless you are comfortable with DashScope/Qwen processing their page images, and choose an output path that will not overwrite important files.

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
SKILL.md:15
Finding
Unpinned Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 15-18 **Vulnerability Type**: Uncontrolled third-party dependency installation **Risk Level**: Medium ### Evidence ```bash ## Prerequisites 1. **DashScope API Key:** A valid key from Alibaba Cloud Bailian with `qwen-vl-max` access. 2. **Environment:** ```bash pip install pymupdf dashscope ``` ``` ### Technical Analysis The installation instructions retrieve `pymupdf` and `dashscope` from the active Python package index without pinning reviewed versions or verifying package hashes. Package versions can therefore change independently of the audited Skill. Python package installation may execute package-controlled build or installation logic. If a dependency, transitive dependency, maintainer account, or configured package index is compromised, following the documented command could execute unreviewed code with the privileges of the user running `pip`. The package names are consistent with the imports in `scripts/vision_parse.py`, and the project does not direct users to an obviously suspicious repository or similarly named package. This is therefore a supply-chain hardening issue rather than evidence that the current dependencies are malicious. ### Attack Path 1. An attacker compromises a listed dependency, one of its transitive dependencies, its publisher account, or a package index used by the victim. 2. The attacker publishes a malicious package version that still satisfies the unrestricted installation command. 3. A user follows the Skill documentation and runs `pip install pymupdf dashscope`. 4. `pip` downloads the attacker-controlled release and may execute its build or installation code. 5. The malicious package runs with the installing user's privileges and can subsequently execute again when the parser imports it. ### Impact Assessment Successful exploitation could permit arbitrary code execution under the account installing or running the Skill. The resulting access cou ...[truncated 373 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create a dependency file that pins reviewed versions, including relevant transitive dependencies. 2. Record and enforce cryptographic hashes, for example through a hash-locked requirements file and `pip install --require-hashes`. 3. Generate the lock file from a controlled package index and review dependency changes before updating it. 4. Recommend installation inside a dedicated virtual environment rather than a system-wide or privileged Python environment. 5. Add automated dependency vulnerability and provenance scanning to the release process. 6. Explicitly warn users not to run dependency installation as `root` or an administrator. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:24
Finding
API Key Exposure Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 24; `scripts/vision_parse.py`, lines 62-67 **Vulnerability Type**: Sensitive credential exposure through process arguments and shell history **Risk Level**: Medium ### Evidence Documentation at `SKILL.md:24` recommends supplying the secret directly on the command line: ```bash python scripts/vision_parse.py --pdf <path_to_pdf> --out <path_to_output.md> --api-key <YOUR_API_KEY> --max-pages 2 ``` The script accepts and prioritizes that command-line value at `scripts/vision_parse.py:62-67`: ```python parser = argparse.ArgumentParser(description="French PDF Vision Parser Skill (v0.1)") parser.add_argument("--pdf", required=True, help="Input PDF path") parser.add_argument("--out", required=True, help="Output Markdown path") parser.add_argument("--api-key", required=False, help="DashScope API Key") parser.add_argument("--max-pages", type=int, default=2, help="Max pages to process (default 2, -1 for all)") args = parser.parse_args() api_key = args.api_key or os.getenv("DASHSCOPE_API_KEY") ``` ### Technical Analysis Command-line arguments are commonly retained in interactive shell history and may be captured by terminal recording, job runners, monitoring agents, diagnostic reports, or CI logs. Depending on operating-system process visibility rules, command arguments may also be observable by other local users while the process is running. Although the script supports the `DASHSCOPE_API_KEY` environment variable, the documented basic command encourages the less secure command-line mechanism. The program also gives the exposed command-line value precedence over the environment variable. This issue does not constitute privilege escalation by itself. It creates a credential-disclosure path that can allow an observer to act with the cloud-service permissions associated with the stolen API key. ### Attack Path 1. A user follows the documented example and includes a valid DashScope API key in th ...[truncated 916 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--api-key` option so secrets cannot be supplied in process arguments. 2. Read the credential from `DASHSCOPE_API_KEY` or a protected operating-system or cloud credential provider. 3. Update the documented invocation to omit the key: ```bash export DASHSCOPE_API_KEY="..." python scripts/vision_parse.py --pdf notes.pdf --out notes.md ``` 4. Warn users that environment variables can still be exposed by logs or improperly configured process environments and should not be printed. 5. For interactive use, optionally obtain the key with `getpass.getpass()` so it is not echoed or stored in shell history. 6. Recommend narrowly scoped credentials, usage limits, regular rotation, and immediate revocation of any key previously exposed in command history or logs. 7. Ensure exceptions and debug logging never include the API key. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill invokes a Python script that requires environment access for an API key and writes output files, but the manifest does not declare any tool scope or permissions. This can cause agents or users to run the skill without clear boundaries on filesystem and secret-handling behavior, increasing the chance of unintended file writes or unsafe access to sensitive environment data.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill sends rendered PDF page images to the external Qwen-VL-Max API, but the description does not warn users that document contents leave the local environment. PDFs often contain sensitive personal, legal, financial, or proprietary information, so omission of this disclosure can lead to unintentional data exfiltration to a third-party service.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script sends rendered PDF page images to a third-party vision API, which can disclose sensitive document contents to an external service without an explicit runtime warning or consent checkpoint. In this skill's context, PDFs may contain personal, financial, educational, or proprietary information, so silent transmission meaningfully increases privacy and compliance risk.

Intent-Code Divergence

Low
Confidence
95% confidence
Finding
The docstring says the function will transcribe "the French-Chinese notes," but the manifest describes a multilingual PDF parser for many languages and the prompt/code operate on generic document and language-learning content. This is an active documentation contradiction about intended scope, not just missing detail.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The argument parser description labels the tool as a "French PDF Vision Parser Skill," while the manifest says it is a universal multilingual parser and the prompt explicitly targets multilingual documents. This creates an intent-code/documentation mismatch about what the skill is for.

Missing User Warnings

Low
Confidence
83% confidence
Finding
Opening the output path with mode 'w' will create or overwrite the target file. Although writing output is part of the tool's purpose, the code provides no confirmation prompt or explicit notice that an existing file may be replaced.

Static analysis

No suspicious patterns detected.