Back to skill

Security audit

fast-ocr

Security checks for vulnerabilities and agentic risk

Overview

This OCR skill appears aimed at local receipt text extraction, but it needs review because its offline/no-network claims conflict with an unpinned dependency and first-run model download.

Review before installing in sensitive environments. Only process documents you intend to OCR, treat extracted output as confidential, and prefer a pinned dependency plus verified or pre-cached OCR models before using this with financial, tax, medical, or travel records.

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
requirements.txt:1
Finding

Unpinned Third-Party Dependency and Unverified Runtime Model Retrieval

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1
Related Locations: README.md:4-8, README.md:138-144, SKILL.md:185-190, SKILL.md:388-390
Vulnerability Type: Third-party supply-chain exposure
Risk Level: Medium

Complete Vulnerable Code Snippet:

text
rapidocr-onnxruntime>=1.2.3

The documented installation and runtime behavior is:

bash
pip install rapidocr-onnxruntime
text
The first run downloads a model of approximately 100 MB.

Technical Analysis

The dependency specification provides only a minimum version and does not constrain installation to a specific audited release. A normal package installation can therefore resolve to any later compatible version available from the configured Python package index. The project also provides no lock file or package hashes with which to verify the resolved distribution.

In addition, project documentation states that the dependency downloads OCR model data during first use. The repository does not identify or pin the model version, source URL, or cryptographic digest. Consequently, the executable Python dependency and the model artifact used at runtime are not reproducible or independently integrity-verified by this project.

This behavior also conflicts with the declaration in claw.json that the skill performs no network access. Although no direct network client is implemented in rapidocr_minimal.py, network activity may occur transitively through rapidocr-onnxruntime.

Attack Path

  1. An attacker compromises an eligible future release of rapidocr-onnxruntime, its distribution account, package-index delivery path, or the upstream model distribution channel.
  2. A user follows the documented command or installs requirements.txt.
  3. Because the requirement accepts every version at or above 1.2.3, the package manager can select the compromised release without requiring a repository change.

...[truncated 1090 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin rapidocr-onnxruntime to an exact release that has been reviewed, for example using rapidocr-onnxruntime==<audited-version>.
  2. Generate a reproducible lock file and require cryptographic hashes during installation, such as through a hash-locked requirements file and pip install --require-hashes.
  3. Record the authoritative source, exact version, and SHA-256 digest of every OCR model.
  4. Verify each model's digest before loading it and reject missing or mismatched artifacts.
  5. Where licensing and package-size constraints permit, distribute the verified model with the skill rather than downloading it at runtime.
  6. If runtime retrieval remains necessary, restrict downloads to an authenticated HTTPS origin, prevent redirects to untrusted hosts, use a trusted local cache, and fail closed on verification errors.
  7. Update claw.json and the documentation so the network behavior is represented accurately. Do not claim fully offline operation until all required artifacts have already been installed and verified.
  8. Add automated dependency and artifact provenance checks to the release process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The README exclusively uses Chinese for the skill name, commands, and usage instructions, which effectively forces a specific language experience without user opt-in. The file does not state that the skill is intentionally limited to Chinese-speaking users or provide an alternative language option.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README promotes OCR extraction of invoices, travel tickets, and reimbursement documents, which commonly contain sensitive personal and financial data such as names, tax IDs, bank details, and travel itineraries. Omitting any privacy warning or data-handling guidance can lead users to process regulated or confidential information without understanding storage, retention, redaction, or consent risks.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill states it is 'completely offline' while also disclosing that the first run downloads OCR models. That contradiction can mislead users into providing sensitive invoice, travel, or medical images under the false assumption that no network activity will occur. In a privacy-sensitive OCR context, inaccurate network claims materially affect trust and deployment decisions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises very broad trigger phrases like 'OCR', '文字识别', and '图片转文字', which overlap heavily with ordinary user requests. Without clear activation boundaries, the platform may invoke this skill unexpectedly on unrelated images or documents, increasing the chance of unnecessary processing of sensitive content such as invoices, IDs, tickets, or screenshots. The OCR context makes this more dangerous because the output may expose personal and financial data at scale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The output examples and batch-save behavior show that OCR results may include tax IDs, bank details, names, travel data, and medical billing information, yet the skill does not clearly warn that outputs and saved files can contain highly sensitive personal or financial data. Users may inadvertently store, share, or log these results insecurely. In this document-processing context, the omission increases privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide markets the skill as 'fully offline' while simultaneously disclosing a first-run model download, which is a materially important network behavior. This can mislead reviewers and users about privacy, egress, and deployment assumptions, especially in restricted or air-gapped environments where any outbound connection is security-relevant.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The extraction logic relies entirely on Chinese text patterns such as 发票代码, 发票号码, 购买方, 销售方, and Chinese date/currency formats, but the file does not state that the skill is limited to a Chinese locale or provide any user opt-in for this locale-specific behavior. This creates a natural-language locale constraint that is implicit rather than documented or selectable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code processes invoice and train-ticket images, extracts fields such as tax IDs and amounts, and prints structured results to stdout. While the script shows usage messages, it does not include any user-facing warning, comment, or docstring disclosing that potentially sensitive personal or financial data will be read and displayed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The security promise states there are no network requests except the first model download, but the same file presents external documentation, GitHub, issue tracker, and marketplace URLs as operational support endpoints. While this may not prove runtime code behavior, the documentation creates an intent-level contradiction about the skill's claimed network isolation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The file contains natural-language statements such as "Supports Chinese VAT invoices and train tickets" and the tag "chinese," which impose a locale-specific scope. Because no user opt-in or explicit justification for the locale constraint is provided in the policy-facing description, this may violate the language/locale policy rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The package description is written entirely in Chinese, which can indicate a language-specific constraint without offering users any language or locale choice. Under the policy, language-forcing behavior should be explicitly justified or presented as an opt-in when not clearly documented as region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency is specified with a lower-bound version only, which allows installation of any newer release, including unreviewed major versions or compromised upstream releases. This weakens build reproducibility and increases supply-chain risk because different environments may resolve to different package versions over time.

Content

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

text
rapidocr-onnxruntime>=1.2.3