Back to skill

Security audit

protected-doc-pdf-exporter

Security checks for vulnerabilities and agentic risk

Overview

The scanners mark this skill suspicious because they report concerns about exporting restricted documents, copying browser session data, and an installer that runs unverified downloaded code; analysis was partial, so the evidence is incomplete.

Consider not installing until the export and watermark behavior is authorized for your documents, browser-session copying is clearly understood, and the installer and dependencies have been independently reviewed and verified. The scan labels the result suspicious, not malicious; its analysis was partial, and it does not establish that the reported dependency advisories affect installed versions.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (20)

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The shell pipeline turns downloaded, unverified content directly into executable commands. This is the same supply-chain exposure identified by SC2, rather than separate evidence of malicious tool chaining.

Content

Scanner excerpt · README.md (reported line 92)May include surrounding context.

在终端中执行以下一键安装命令,将自动克隆仓库、安装依赖并配置全局 CLI 与 AI Agent Skill:

bash
curl -fsSL https://raw.githubusercontent.com/Nelson-zhou/protected-doc-pdf-exporter/main/install.sh | bash

3. 方式二:手动克隆与安装

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · README.md (reported line 163)May include surrounding context.

1. 全局安装到 AI 技能库

bash
# 克隆到 Antigravity 全局技能库(跨所有工作区永久生效)
git clone https://github.com/Nelson-zhou/protected-doc-pdf-exporter.git ~/.gemini/config/skills/protected-doc-pdf-exporter

# 安装依赖
pip install -r ~/.gemini/config/skills/protected-doc-pdf-exporter/requirements.txt

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · README.md (reported line 166)May include surrounding context.

git clone https://github.com/Nelson-zhou/protected-doc-pdf-exporter.git ~/.gemini/config/skills/protected-doc-pdf-exporter

安装依赖

pip install -r ~/.gemini/config/skills/protected-doc-pdf-exporter/requirements.txt

text

### 2. 项目工作区安装(供团队协作与代码仓库共享)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

快速调用与命令行语法

bash
python3 ~/.gemini/config/skills/protected-doc-pdf-exporter/scripts/export_doc.py \
    --url "<DOCUMENT_URL>" \
    --output "<OUTPUT_PDF_PATH>" \
    [--pages "all" | "1-10" | "1,3,5-8"] \

Frames viewing access as sufficient authorization to export restricted documents and remove accountability watermarks.

High
Category
Prompt Injection
Confidence
98% confidence
Finding

The activation criteria explicitly include disabled downloads, permission errors, and removal of employee-identifying anti-leak watermarks. Viewing access does not establish authorization to export or remove accountability markings, so automatic execution can undermine document-owner controls and facilitate untraceable disclosure.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · install.sh (reported line 9)May include surrounding context.

sh
set -euo pipefail

SKILL_NAME="protected-doc-pdf-exporter"
INSTALL_DIR="${HOME}/.gemini/config/skills/${SKILL_NAME}"
BIN_DIR="${HOME}/.local/bin"
REPO_URL="https://github.com/Nelson-zhou/protected-doc-pdf-exporter.git"

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Automatic browser-session cloning lacks a warning about copying sensitive authentication data.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The skill directs automatic cloning of browser authentication state without a specific warning or consent step for copying sensitive session material. A normal document-export request can therefore cause duplication of credentials for unrelated services, substantially broadening the sensitive data handled by the workflow.

Content

No source excerpt is available for this finding.

L107–L109 silently delete an existing destination directory before cloning the profile, without disclosing this destructive behavior.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

The function recursively deletes any existing destination before establishing that it owns that directory. Its caller uses a predictable temporary path derived from a port number, making collisions or local interference possible and creating a risk of deleting pre-existing data.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · browser_manager.py (reported line 170)May include surrounding context.

python
cmd.insert(1, "--headless=new")

        print(f"[*] Spawning {os.path.basename(self.binary_path)} on CDP port {self.port}...")
        self.proc = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

        # Wait for CDP endpoint
        for _ in range(30):

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · browser_manager.py (reported line 176)May include surrounding context.

python
for _ in range(30):
            await asyncio.sleep(0.5)
            try:
                resp = urllib.request.urlopen(f'<redacted-url>', timeout=1)
                tabs = json.loads(resp.read().decode())
                page_tabs = [t for t in tabs if t.get('type') == 'page']
                if page_tabs:

L85-L87 capture the entire page viewport rather than the document canvas or element viewport promised by the manifest.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

Page.captureScreenshot is invoked without a document-specific clip, so it captures the page viewport, including unrelated application content that remains visible after the limited CSS cleanup. Account details, sidebars, or notifications could consequently be embedded in the exported artifact and disclosed when it is shared; this does not imply capture of browser chrome or other desktop windows.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · install.sh (reported line 44)May include surrounding context.

sh
echo "[!] Warning: pip install returned non-zero. Please verify dependencies manually."
}

# 4. Create symlink in ~/.local/bin for global CLI access
mkdir -p "${BIN_DIR}"
ln -sf "${INSTALL_DIR}/export_doc.py" "${BIN_DIR}/export-doc"
chmod +x "${INSTALL_DIR}/export_doc.py"

External Script Fetching

Low
Category
Supply Chain
Confidence
99% confidence
Finding

The recommended command executes a remotely fetched script from a mutable branch without reviewing or verifying its contents. A compromised repository or malicious upstream change could execute arbitrary commands with the user's privileges.

Content

Scanner excerpt · README.md (reported line 92)May include surrounding context.

在终端中执行以下一键安装命令,将自动克隆仓库、安装依赖并配置全局 CLI 与 AI Agent Skill:

bash
curl -fsSL https://raw.githubusercontent.com/Nelson-zhou/protected-doc-pdf-exporter/main/install.sh | bash

3. 方式二:手动克隆与安装

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The lower-bound constraint permits future, unreviewed websockets releases, making installations nonreproducible and potentially exposing them to compromised or incompatible updates. Its use for browser-session communication increases the importance of dependency integrity, although this file shows no actual compromise.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
websockets>=11.0.3
PyMuPDF>=1.23.0
Pillow>=10.0.0

Unverifiable Dependency: websockets has 4 known advisory(ies) (CVE-2018-1000518 (websockets is vulnerable to denial of service by memory exhaustion); CVE-2021-33880 (Observable Timing Discrepancy in aaugustin websockets library); CVE-2018-1000518 (aaugustin websockets version 4 contains a CWE-409: Improper Handling of Highly C) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The PyMuPDF constraint allows unreviewed releases rather than establishing a reproducible dependency set. Since this skill generates PDFs, a compromised dependency could run within the document-processing workflow, but no compromised release is established here.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
websockets>=11.0.3
PyMuPDF>=1.23.0
Pillow>=10.0.0

Unverifiable Dependency: PyMuPDF has 2 known advisory(ies) (CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py); CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The Pillow lower bound permits installations to change without review, creating a dependency-integrity and reproducibility weakness. Image processing is central to the stated workflow, making this dependency relevant to security, although unpinned versions alone do not demonstrate an exploitable parser flaw.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
websockets>=11.0.3
PyMuPDF>=1.23.0
Pillow>=10.0.0

Unverifiable Dependency: Pillow has 214 known advisory(ies) (CVE-2026-112390 (Pillow: Infinite loop in MIC n_frames when the embedded TIFF); CVE-2026-96638 (Pillow: BMP RLE decoder memory-amplification DoS via unbounded delta escape / ab); CVE-2026-112391 (Pillow: PdfParser can recurse without limit in get_value() and linearize_page_tr) +211 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

OSV returned advisories for this package, but its resolved version is unknown. A package-name lookup does not establish whether the installed release is affected by those advisories.

Content

No source excerpt is available for this finding.