Back to skill

Security audit

Cn Web Image Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill locally compresses images and shows no evidence of hidden network access, persistence, credential handling, or destructive behavior beyond writing output image files.

Install dependencies in a virtual environment and pin Pillow if you need reproducible builds. When using custom output paths or rerunning batch compression, check whether destination files already exist because the tool may overwrite optimized outputs.

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
SKILL.md:92
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md:92-100` **Vulnerability Type**: Unpinned and unverified third-party dependency **Risk Level**: Medium ### Vulnerable Code ```markdown ## Dependencies - Python 3.6+ - Pillow (PIL) - Standard Python imaging library Install Pillow if needed: ```bash pip3 install Pillow ``` ``` ### Technical Analysis The documented installation command asks users to install Pillow without a version constraint, lockfile, package hash, or isolated environment. Consequently, `pip3` resolves a mutable package version from its configured package index at installation time. Although the audit found no evidence that Pillow itself is malicious, this dependency practice creates a supply-chain exposure. If the upstream package, maintainer account, distribution artifact, or configured package index were compromised, installation could introduce attacker-controlled code that was not part of the reviewed Skill. Package installation behavior and subsequently imported library code execute with the permissions of the user running the command. ### Attack Path 1. An attacker compromises the relevant upstream release process, package repository, maintainer account, or package index used by the victim. 2. The attacker publishes or substitutes a malicious Pillow distribution that satisfies the unconstrained package name. 3. A user follows the Skill documentation and runs `pip3 install Pillow`. 4. `pip3` resolves and installs the attacker-controlled distribution because no approved version or artifact hash is enforced. 5. Malicious installation behavior or imported package code executes with the privileges of the invoking user. ### Impact Assessment Successful exploitation could execute arbitrary code with the permissions of the user who installs or runs the dependency. Depending on that user's privileges and environment, the attacker could access or modify user-readable files, alter the Pytho ...[truncated 212 chars]
Remediation
## Remediation Suggestions 1. Pin Pillow to a reviewed, supported version in a dependency file rather than installing an unconstrained latest release. 2. Generate and verify cryptographic hashes for approved distribution artifacts, then install with: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Use a dedicated virtual environment so the dependency cannot modify a shared or system-wide Python installation: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt ``` 4. Review and update the pinned version through a controlled dependency-update process that includes vulnerability scanning and testing. 5. Configure `pip` to use a trusted package index and avoid installing with administrative or root privileges.
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The module docstring states output quality is always visually acceptable with no perceptible quality loss. However, the implementation explicitly downsizes image dimensions when quality reduction alone cannot meet the target size, which can introduce perceptible loss of detail and contradicts the absolute documentation claim.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The tool writes directly to a user-specified output path with normal file open semantics and no existence check, warning, or confirmation. In contexts where the caller passes a sensitive or important path by mistake, this can silently overwrite existing files and cause data loss; the risk is higher because this skill is explicitly designed to process many files and operate on arbitrary user-provided paths.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This code performs file writes when saving optimized images, and batch mode repeats that behavior across a directory. Although the CLI names like 'compress' imply output creation, the file lacks an explicit warning or confirmation that new files will be written alongside existing images and may consume disk space or overwrite a user-specified output path.

Description-Behavior Mismatch

Low
Confidence
86% confidence
Finding
The manifest says the skill supports TIFF input, which commonly includes both .tiff and .tif extensions. In batch mode, the supported extension set includes '.tiff' but not '.tif', so some valid TIFF inputs will not actually be processed despite the broad claim of TIFF support.

Intent-Code Divergence

Low
Confidence
92% confidence
Finding
The manifest and CLI present the skill as fitting images under a configurable maximum size, but print_result marks results as 'OK' only when output_size_kb <= 500. If a user sets a different --max-kb value, the displayed status can contradict the tool's actual configured intent and outcome.

Static analysis

No suspicious patterns detected.