Back to skill

Security audit

Super Ocr

Security checks for vulnerabilities and agentic risk

Overview

This OCR skill appears purpose-aligned, but it includes environment-modifying dependency installation and unsafe temporary-file handling that users should review before installing.

Install only after reviewing the setup path. Prefer a virtual environment, avoid running the installer with elevated privileges, manually pin and review OCR dependencies, and do not run Tesseract preprocessing in shared directories where a matching *_tess_processed.png file may already exist.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:4
Finding

Unpinned Dependencies and Unsafe Automatic Package Installation

Content
View full analysis
bool: # ... install_cmd = dep.get('install_cmd') if not install_cmd: print(f"[INFO] No auto-install command for {dependency}") return False print(f"[INFO] Installing {dependency}...") print(f" Command: {install_cmd}") try: result = subprocess.run( install_cmd.split(), capture_output=True, text=True, timeout=120 ) ``` ### Technical Analysis All third-party packages are specified without exact versions or integrity hashes. The built-in installer consequently asks the active `pip` executable to resolve the latest package versions and their transitive dependencies from its configured package index. Although the package names match the documented OCR functionality and the installer does not use a shell, the effective code installed can change without any modification to this Skill. Python ...[truncated 1619 chars]
Remediation
View remediation
paddlepaddle== pytesseract== pillow== opencv-python== numpy== ``` 2. Generate a lockfile that also constrains transitive dependencies. 3. Require package hashes, for example through a hash-locked requirements file and: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Replace `pip` from `PATH` with the interpreter-associated invocation: ```python subprocess.run( [sys.executable, "-m", "pip", "install", "--require-hashes", "-r", str(lockfile)], check=True, capture_output=True, text=True, timeout=120 ) ``` 5. Disable automatic dependency installation by default. Provide the exact proposed command and require explicit user confirmation. 6. Document and enforce an approved HTTPS package index. 7. Scan locked dependencies for known vulnerabilities and update them through a controlled review process. 8. Correct the security policy so its dependency-pinning claims accurately reflect the implementation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/engine/tesseract.py:106
Finding

Predictable Temporary Image Path Permits File Overwrite and Deletion

Content
View full analysis
_tess_processed.png` already exists, `cv2.imwrite` may overwrite it. The cleanup logic then unconditionally removes the path. Concurrent OCR operations on input files with the same stem can also overwrite or delete each other's temporary data. In a directory writable by another local user or process, an attacker may pre-create the predictable path. Depending on operating-system and OpenCV file-handling behavior, a symbolic link or other filesystem re ...[truncated 1818 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documentation describes behavior beyond the declared OCR purpose, including batch processing, writing results to disk, and use of an additional OCR engine. In an agent context, undeclared file-writing and broader execution paths are security-relevant because they expand the skill's effective authority beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

Ubuntu/Debian:

bash
sudo apt update && sudo apt install tesseract-ocr

Windows:

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/troubleshooting.md (reported line 33)May include surrounding context.

Ubuntu/Debian:

bash
sudo apt update && sudo apt install tesseract-ocr

Windows:

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/dependencies.py (reported line 194)May include surrounding context.

python
**Ubuntu/Debian:**
```bash
sudo apt update && sudo apt install tesseract-ocr
```

**Windows:**

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises capabilities that involve shell execution, network access, and file writes, but it does not declare any explicit tool scope or permissions boundaries. In an agent setting this increases the chance of unintended command execution, environment modification, or data writes without clear operator awareness or policy enforcement.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description presents the skill as a dual-engine OCR tool using Tesseract and PaddleOCR with intelligent selection between them. Later documentation adds a third engine, 'MacVision,' and an '--engine all' mode including it, which conflicts with the stated scope and documented engine model.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The 'Auto Mode (Default)' section says the skill 'automatically selects the optimal engine,' which implies choosing one engine based on the scenario. Later, the usage example describes auto mode as 'runs all available engines,' which is a contradictory statement about core behavior rather than a minor omission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation promotes --install auto-installation without warning that it will modify the user's Python or system environment. In an agent or automation context, silent dependency installation can introduce supply-chain exposure, alter interpreter state, and violate user expectations about non-destructive operation.

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 60)May include surrounding context.

Ubuntu/Debian:

bash
sudo apt update && sudo apt install tesseract-ocr

Windows:

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 · references/troubleshooting.md (reported line 33)May include surrounding context.

Ubuntu/Debian:

bash
sudo apt update && sudo apt install tesseract-ocr

Windows:

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The dependency helper goes beyond OCR by installing Python packages on the user's system, which is broader than the advertised capability and gives the skill environment-modifying behavior. In an agent setting, this is risky because it can lead to unexpected code execution during package installation, supply-chain exposure, and persistence-changing side effects.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
90% confidence
Finding

This code can automatically install packages by invoking pip, which causes the skill to modify the host environment and execute package installation logic outside the OCR skill's core function. Although the command strings are currently static and not directly user-influenced, auto-installing dependencies expands the attack surface and can introduce unreviewed code from package indexes at runtime.

Content

Scanner excerpt · scripts/dependencies.py (reported line 146)May include surrounding context.

python
print(f"       Command: {install_cmd}")
    
    try:
        result = subprocess.run(
            install_cmd.split(),
            capture_output=True,
            text=True,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file adds a macOS-specific OCR backend using Apple's Vision framework via Swift, but that capability is not reflected in the stated engine scope. Hidden or undocumented execution paths reduce transparency, weaken reviewability, and can expose users to unexpected platform-specific behavior and permissions surfaces.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The OCR module launches an external Swift interpreter and script, which exceeds a typical in-process OCR expectation and introduces an additional code-execution surface. Even without shell injection, undocumented interpreter execution increases supply-chain and integrity risks because a modified script or unexpected runtime behavior could execute arbitrary code in the skill's context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/engine/macvision.py (reported line 62)May include surrounding context.

python
try:
            # Run Swift script with image path as argument
            result = subprocess.run(
                ['swift', str(SWIFT_SCRIPT_PATH), image_path],
                capture_output=True,
                text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code explicitly expects stdout lines beginning with the Chinese labels '文本:' and '置信度:', and even comments describe this as 'Parse Chinese output'. This creates a locale-specific behavior with no opt-in, fallback, or documented user choice, which matches the policy rule against forcing a specific language/locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The OCR request is constrained to zh-Hans, zh-Hant, and en-US, which imposes specific language/locale behavior by default. Under the policy, forcing a specific language or locale without user opt-in or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The constructor sets lang: str = 'ch' as the default, which forces a specific language/locale behavior unless the caller overrides it. The file does not explain why Chinese is the required default or present it as an explicit user choice, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.