Back to skill

Security audit

LiaoGong-OCR

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent OCR skill with ordinary local image-processing behavior, though its documentation overstates some capabilities and uses mutable dependency/install versions.

Install it in a virtual environment, prefer pinned or reviewed dependency versions, and invoke it explicitly for sensitive screenshots or photos. Expect local OCR behavior, but do not rely on the advertised automatic engine selection or full 15-chain feature set without testing.

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:27
Finding
Unpinned Third-Party Dependencies Enable Mutable Supply-Chain Execution<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:27` - `README.md:52` - `requirements.txt:1-4` - `setup.py:39-44` **Vulnerability Type**: Unpinned and inconsistently constrained third-party dependencies **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:27`: ```bash npx clawhub@latest install liaogong-ocr ``` `README.md:52`: ```bash npx clawhub@latest install liaogong-ocr ``` `requirements.txt:1-4`: ```text easyocr>=1.7.0,<2.0.0 pytesseract>=0.3.10 Pillow>=10.0.0 numpy>=1.24.0 ``` `setup.py:39-44`: ```python install_requires=[ "easyocr>=1.7.0", "pytesseract>=0.3.10", "Pillow>=10.0.0", "numpy>=1.24.0", ], ``` ### Technical Analysis The documented `npx clawhub@latest` command downloads and executes the package release currently associated with the mutable `latest` tag. The effective code executed by users can therefore change after this skill has been reviewed, without any corresponding modification to the audited repository. The Python dependencies are also specified using version ranges or lower bounds rather than immutable versions and verified hashes. Consequently, two installations performed at different times can resolve to different dependency versions and transitive dependency graphs. There is also a constraint inconsistency: `requirements.txt` restricts EasyOCR to versions below 2.0.0, while `setup.py` has no upper bound. Installation through `pip install .` can therefore resolve a materially different dependency set from installation through `pip install -r requirements.txt`. No malicious upstream package or malicious payload was identified in the audited repository. The risk arises from allowing future or compromised upstream releases to enter the installation path without version or integrity verification. ### Attack Path 1. An attacker compromises an upstream package publisher, package registry account, dependency release process, or mutable distribution tag. 2. The attacker publishes a modi ...[truncated 1373 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the mutable `latest` reference with a reviewed exact version: ```bash npx clawhub@<reviewed-version> install liaogong-ocr ``` 2. Where supported, pin the npm package by integrity hash or use a lock file that records the resolved version and integrity metadata. 3. Pin direct and transitive Python dependencies through a reproducible lock file. Generate hash-verified requirements, for example: ```bash pip-compile --generate-hashes requirements.in pip install --require-hashes -r requirements.txt ``` 4. Align dependency constraints between `setup.py` and `requirements.txt`. In particular, apply the same reviewed EasyOCR upper bound in all installation configurations. 5. Prefer modern packaging metadata in `pyproject.toml` and maintain a separately generated, hash-locked deployment dependency file. 6. Use automated dependency monitoring, but require testing and security review before changing pinned versions. 7. Install dependencies inside an isolated virtual environment or container and avoid running package installation as an administrator or root user. 8. In CI/CD environments, minimize installation-time access to secrets and use restricted network and filesystem permissions to reduce the impact of a compromised dependency. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The core declared purpose—OCR text extraction from images via easyocr+tesseract—is broadly accurate. However, the description makes several concrete capability claims that are not represented in this code chunk. The implementation supports only one preprocessing mode ('phone'), not 15 chains; it processes a single image rather than batches; and its tesseract branch is configured primarily for English. The stated 87% phone-photo digit accuracy and benchmarked preprocessing are promotional claims not evidenced by the supplied code. This is a description-behavior mismatch because the advertised feature set is materially broader than what the code chunk actually implements.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description presents a complete OCR skill with dual OCR engines and text extraction capability. However, this code chunk is limited to preprocessing functions that transform images before OCR might occur elsewhere. While the preprocessing benchmarks and phone-photo optimization claims align with part of the description, the primary advertised capability—actual OCR via easyocr+tesseract—is absent from this code. Therefore, the code chunk does not accurately represent the full declared purpose and is materially narrower in behavior.

Rp1

Medium
Category
MCP Rug Pull
Confidence
86% confidence
Finding
The README instructs users to run `npx clawhub@latest install liaogong-ocr`, which fetches and executes the latest remote package code at install time. Using `@latest` makes the executed code non-deterministic and vulnerable to supply-chain compromise if the upstream package is hijacked or publishes a malicious update.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The listed trigger phrases such as `OCR this image`, `图片转文字`, and similar generic requests are broad, natural-language commands that can easily appear in ordinary conversation. This can cause unintended skill activation, potentially routing user content or files to this skill when the user did not explicitly consent to invoking it.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The README states that the AI assistant will 'automatically recognize' broad OCR-related phrases and invoke the skill, but does not define constraints, consent flow, or what content is eligible for processing. In an agent environment, this ambiguity increases the risk of accidental invocation and unintended disclosure of image contents to the OCR pipeline.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Vague Triggers

Medium
Confidence
87% confidence
Finding
The description says "Use when: OCR this image, extract text from images, 图片转文字, OCR识别, 提取图片文字" without narrowing context, exclusions, or explicit trigger boundaries. Phrases like "extract text from images" and "图片转文字" are broad natural requests that could match many ordinary conversations and may cause unintended invocation.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
The installation command uses 'npx clawhub@latest', which pulls whatever version is current at execution time rather than a reviewed, fixed version. This creates a supply-chain risk: a compromised or breaking upstream release could be executed automatically by users or agents installing the skill.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
print("警告:未找到 tesseract。请安装:")
        print("  Windows: winget install tesseract-ocr")
        print("  macOS:   brew install tesseract")
        print("  Linux:   sudo apt install tesseract-ocr")
        return None

    def process(self, image_path, engine='auto', preprocess=None):
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
print("警告:未找到 tesseract。请安装:")
        print("  Windows: winget install tesseract-ocr")
        print("  macOS:   brew install tesseract")
        print("  Linux:   sudo apt install tesseract-ocr")
        return None

    def process(self, image_path, engine='auto', preprocess=None):
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The manifest describes a dual-engine OCR skill supporting Chinese posters/screenshots and an 'auto' capability, implying engine selection consistent with that scope. In code, 'auto' is hardcoded to 'tesseract' and tesseract is called with lang='eng', so the default behavior does not match the advertised dual-engine/Chinese-oriented behavior.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The file presents the skill identity and description entirely in Chinese ('廖工AI设计实战 · LiaoGong-OCR', '双引擎OCR系统') while exposing no indication of language choice or opt-in. For a general-purpose OCR library, this can be a natural-language policy concern because it imposes a locale/language presentation by default rather than offering alternatives or documenting a region-specific scope.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
This code presents the command description, examples, and branding entirely in Chinese, and similar Chinese-only user-facing strings appear throughout the CLI. That can violate a language/locale policy when no user opt-in or alternative locale is offered.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
This file contains user-facing natural-language descriptions and error/help text exclusively in Chinese, including the top-level module description and function docstrings. Under the stated policy, forcing a specific language without offering a language/locale choice can be a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The title "Benchmark Results · 基准测试结果" presents content in a specific additional language without any note that the skill or document is bilingual by user choice or intended for a Chinese-speaking context. Under the language/locale policy, forcing or assuming a locale without opt-in can be a policy concern even in documentation.

Unpinned Dependencies

Low
Category
Supply Chain
Content
easyocr>=1.7.0,<2.0.0
pytesseract>=0.3.10
Pillow>=10.0.0
numpy>=1.24.0
Confidence
93% confidence
Finding
`pytesseract>=0.3.10` is not fully pinned, so builds can resolve to different versions over time. This weakens supply-chain reproducibility and can silently introduce vulnerable or incompatible releases, especially in OCR tooling that commonly processes untrusted image inputs.

Unpinned Dependencies

Low
Category
Supply Chain
Content
easyocr>=1.7.0,<2.0.0
pytesseract>=0.3.10
Pillow>=10.0.0
numpy>=1.24.0
Confidence
98% confidence
Finding
`Pillow>=10.0.0` is unpinned and Pillow has a long history of image parsing vulnerabilities, including memory corruption and resource-consumption issues. Because this skill’s purpose is OCR on potentially user-supplied images, allowing arbitrary newer Pillow versions increases exposure and makes it impossible to verify whether deployed versions are safe.

Unverifiable Dependency: Pillow has 16 known advisory(ies) (CVE-2016-2533 (Pillow buffer overflow in ImagingPcdDecode); CVE-2023-50447 (Arbitrary Code Execution in Pillow); CVE-2021-27922 (Pillow Uncontrolled Resource Consumption) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
97% confidence
Finding
The manifest does not pin Pillow, and Pillow has multiple published advisories affecting image parsing and resource handling. In an OCR skill that ingests external images, inability to verify the exact installed Pillow version is a meaningful security problem because exploitable parser bugs could be reached through normal skill usage.

Unpinned Dependencies

Low
Category
Supply Chain
Content
easyocr>=1.7.0,<2.0.0
pytesseract>=0.3.10
Pillow>=10.0.0
numpy>=1.24.0
Confidence
90% confidence
Finding
`numpy>=1.24.0` is not pinned, so the resolved package may vary by environment and time. While NumPy is less directly exposed than image decoders here, unpinned scientific packages still create supply-chain and reproducibility risk and may inherit known defects or vulnerable releases.

Unverifiable Dependency: numpy has 16 known advisory(ies) (CVE-2014-1859 (Numpy arbitrary file write via symlink attack); CVE-2021-41495 (NumPy NULL Pointer Dereference); CVE-2021-33430 (NumPy Buffer Overflow (Disputed)) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding
The manifest does not pin NumPy, so it is not possible to determine whether a deployment will use a version affected by known advisories. Although NumPy is not the primary parser in this OCR workflow, unverifiable dependency resolution still creates avoidable supply-chain uncertainty and may expose the environment to known package-level flaws.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
This setup file presents the package title and description in Chinese, but does not indicate that the package is intended only for Chinese-speaking users or offer any language/locale choice. Under the policy for natural-language violations, forcing a specific language without opt-in can be a locale policy issue.

Static analysis

No suspicious patterns detected.