Back to skill

Security audit

Img Ocr

Security checks for vulnerabilities and agentic risk

Overview

This is a small OCR skill that reads a user-provided image locally and prints extracted text, with no evidence of hidden data access, persistence, or exfiltration.

Install it only if you are comfortable adding Tesseract and Python OCR dependencies to your machine. Prefer using a virtual environment and pinned package versions, and treat this as an OCR tool for user-selected image files rather than a general image-analysis skill.

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

Note
Location
SKILL.md:12
Finding

Unpinned Python Dependencies

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 12–13
Vulnerability Type: Unpinned third-party dependencies
Risk Level: Low

Complete Code Snippet:

markdown
- pytesseract: `pip3 install pytesseract`
- Pillow: `pip3 install Pillow`

Technical Analysis

The documented installation commands retrieve pytesseract and Pillow without fixed versions or cryptographic hash verification. Consequently, installations may resolve to different package artifacts over time. If the configured package index, a maintainer account, or a future dependency release is compromised, following these commands could install attacker-controlled code.

This is a supply-chain hardening issue rather than evidence that either named package is currently malicious. The reviewed skill does not use an untrusted package name, alternate package index, or remote execution mechanism.

Attack Path

  1. An attacker compromises a relevant package release, maintainer account, or configured Python package index.
  2. A user follows the installation instructions in SKILL.md.
  3. pip3 resolves the unpinned dependency to the compromised artifact.
  4. The artifact executes malicious installation or runtime code under the installing user's account.
  5. The malicious code gains access to resources available to that account.

Impact Assessment

Successful exploitation could permit arbitrary code execution with the privileges of the user performing installation or running the OCR tool. The affected scope could include that user's files, environment variables, credentials accessible to the process, and network access. The reviewed project itself does not request privilege escalation, persistence, or unauthorized access.

Remediation
View remediation

Remediation Suggestions

  • Pin dependencies to reviewed, exact versions in a dedicated requirements file.
  • Record cryptographic hashes and install with:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  • Generate and review lock files through a controlled dependency-update process.
  • Use a trusted package index and prevent unintended fallback to untrusted indexes.
  • Scan dependencies for known vulnerabilities and review transitive dependency changes before updates.
  • Install dependencies in an isolated virtual environment with least-privilege permissions.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says to activate when the user mentions phrases like "image recognition" and "text extraction," which are broad and could match general conversation outside the intended OCR use case. It does not provide tighter scope, exclusions, or negative examples to clarify when this skill should or should not activate.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
- Python3
- pytesseract: `pip3 install pytesseract`
- Pillow: `pip3 install Pillow`
- Tesseract OCR: `sudo apt install tesseract-ocr`
- Chinese lang pack: `sudo apt install tesseract-ocr-chi-sim`

## Quick Usage

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
- Python3
- pytesseract: `pip3 install pytesseract`
- Pillow: `pip3 install Pillow`
- Tesseract OCR: `sudo apt install tesseract-ocr`
- Chinese lang pack: `sudo apt install tesseract-ocr-chi-sim`

## Quick Usage

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code includes a natural-language comment and OCR configuration that force recognition to Chinese Simplified plus English only (lang='chi_sim+eng'). Under the policy, locale or language constraints should not be forced without user opt-in unless clearly justified as region-specific, and this file provides no such choice or justification.

Content

No source excerpt is available for this finding.