Back to skill

Security audit

Compress pdf file

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims: it compresses a user-selected PDF and writes a new compressed copy, with ordinary dependency and disclosure caveats.

Before installing, use it only on PDFs you are comfortable processing locally, expect medium/high compression to remove metadata and reduce image quality, and prefer a release with a committed lockfile or pinned dependencies for more reproducible installs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
pyproject.toml:7
Finding
Unpinned Dependencies Permit Mutable Supply-Chain Code Execution## Vulnerability Details **File Location**: `pyproject.toml:7-10`, `pyproject.toml:13-15`; execution and installation behavior is documented in `SKILL.md:5-6` and `README.md:42,54-58` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium **Vulnerable code:** ```toml dependencies = [ "loguru>=0.7.2", "pydantic>=2.0.0", "pymupdf>=1.23.0", ] [build-system] requires = ["hatchling"] build-backend = "hatchling.build" ``` The Skill entry point causes dependency resolution to occur through `uv`: ```yaml runtime: shell entrypoint: "uv run src/main.py" ``` The installation instructions also explicitly direct users or the platform to resolve dependencies: ```text The platform automatically reads pyproject.toml / uv.lock and installs dependencies through uv. uv sync uv run src/main.py --pdf_path "/path/to/test.pdf" --compression_level 2 ``` ### Technical Analysis All runtime dependencies use open-ended minimum-version constraints, while the build dependency has no version constraint. No lockfile, package hashes, upper version bounds, or trusted-index configuration was present in the audited project. Consequently, the reviewed source does not uniquely determine which third-party code will be installed. A future version satisfying these constraints can be selected by `uv sync`, `uv run`, or the hosting platform's package installation process. Python packages and build backends may execute code during build, installation, import, or normal runtime. This creates a supply-chain exposure if an upstream package, its publishing account, the configured package index, or a transitive dependency is compromised. This finding does not establish that the currently named packages are malicious. The vulnerability is the mutable and unverifiable dependency resolution policy. ### Attack Path 1. An attacker compromises the publishing account, distribution infrastructure, or pack ...[truncated 1276 chars]
Remediation
## Remediation Suggestions 1. Generate and commit a reviewed `uv.lock` file so direct and transitive dependency versions are deterministic. 2. Run deployment and production commands in locked or frozen mode so dependency metadata cannot be silently re-resolved. 3. Pin the build backend to a reviewed version rather than using unrestricted `hatchling`. 4. Verify downloaded distributions with cryptographic hashes or an equivalent artifact-integrity mechanism. 5. Configure an explicitly trusted package index and prevent unintended fallback to public or untrusted indexes. 6. Review and update dependencies through a controlled process that includes vulnerability scanning, provenance checks, and test execution. 7. Build deployable artifacts in an isolated environment, then promote the immutable reviewed artifacts instead of resolving dependencies when the Skill starts. 8. Run the Skill under a least-privileged account with restricted filesystem access, environment-variable exposure, and network connectivity to limit supply-chain compromise impact.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose is a PDF compression skill, but the provided code does not implement any such capability. The only code shown is an empty package initialization file with a comment, so the actual behavior does not match the stated functionality. This is a material mismatch in primary purpose rather than a minor implementation detail.

Missing User Warnings

Medium
Confidence
85% confidence
Finding
This code performs safety-relevant actions: it modifies document content by scrubbing metadata, rewriting images, and saving a new file. While there is internal logging on failure paths, there is no user-facing disclosure, confirmation, or comment warning that compression level 2+ removes hidden metadata and reduces image quality.

Natural-Language Policy Violations

Low
Confidence
74% confidence
Finding
The natural-language documentation is presented almost entirely in Chinese, with no indication that other languages are supported or that the language choice is intentional and optional. Per the policy, forcing a specific language without opt-in can be a locale/language policy issue.

Missing User Warnings

Low
Confidence
82% confidence
Finding
This markdown file describes compressing a specified PDF and returning an output path, which implies creating or altering files on disk. The description does not include any warning about file output behavior, potential overwrites, or the need to verify the target path, so users are not clearly informed about data-affecting behavior.

Unverifiable Dependency: loguru has 2 known advisory(ies) (CVE-2022-0338 (loguru logs sensitive information); CVE-2022-0338 (Improper Privilege Management in Conda loguru prior to 0.5.3.)), 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
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Unverifiable Dependency: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +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
82% confidence
Finding
The manifest allows any pydantic version >=2.0.0, so installs may resolve to different releases over time, including potentially vulnerable ones if future constraints are not controlled. Because pydantic has had denial-of-service and parsing-related advisories, leaving it unpinned creates avoidable supply-chain risk even though no exploit is directly embedded in this file.

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
77% confidence
Finding
The manifest allows any pymupdf version >=1.23.0 without an upper bound or exact pin, making the installed version unverifiable and potentially exposing consumers to vulnerable future or transitive resolutions. In the context of a PDF-processing skill, this matters more because PyMuPDF is directly involved in handling untrusted document input, so flaws in that library can be security-relevant to core functionality.

Natural-Language Policy Violations

Low
Confidence
74% confidence
Finding
The natural-language documentation in this file is exclusively Chinese, which can violate language/locale policy when no opt-in or justification is provided. This is a natural-language issue present directly in the code comments/docstring rather than a functional code defect.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
This code contains natural-language comments and docstrings in Chinese, including the logging comment and function descriptions, with no indication that the skill is region-specific or that language choice is optional. Under the stated policy, forcing a specific language without user opt-in can be a locale/language policy violation.

Static analysis

No suspicious patterns detected.