Back to skill

Security audit

看盘之眼

Security checks for vulnerabilities and agentic risk

Overview

This stock OCR skill mostly matches its stated purpose, but it handles financial screenshots and credentials with weak disclosure and unsafe helper code.

Review before installing. Use local OCR where possible, avoid sending financial screenshots to cloud OCR unless you are comfortable with that provider receiving the image, rotate or remove the embedded OCR credentials, and do not run the setup or PowerShell helpers with untrusted paths, window titles, or pasted credential strings.

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 (7)

T09 · Insecure Skill Coding Practices

Error
Location
debug_ocr.py:12
Finding

Hard-Coded Baidu OCR Credentials Exposed in Source Code and Documentation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
simple_ocr.py:98
Finding

Embedded Shared OCR.space API Key

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
setup_ocr.py:12
Finding

Shell Command Injection Through OCR Credential Configuration

Content
View full analysis
Remediation
View remediation
None: subprocess.run( ["setx", name, value], shell=False, check=True, capture_output=True, text=True ) ``` Additional hardening steps: 1. Validate that variable names come from a fixed allowlist. 2. Do not log secret values or complete command lines containing secrets. 3. Prefer a platform API for user environment variables instead of invoking `setx`. 4. Use hidden input such as `getpass.getpass()` for secret entry. 5. Reject control characters and unexpected line breaks. 6. Add tests covering quotes, ampersands, pipes, percent expansion, and other Windows shell metacharacters. 7. Avoid a generic `run_command` helper that defaults to `shell=True`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
capture_ma20_powershell.py:34
Finding

PowerShell Injection Through Window Title and Screenshot Output Path

Content
View full analysis
tuple: ps_script = f''' Add-Type @" using System; using System.Runtime.InteropServices; public class Win32 {{ [DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd); }} "@ $pattern = "{title_pattern}" $foundHwnd = $null $foundTitle = $null ... ''' result = subprocess.run( ['powershell', '-Command', ps_script], capture_output=True, text=True, encoding='utf-8' ) ``` The output path is handled in the same unsafe manner: ```python def capture_window(hwnd: str, output_path: str) -> bool: ps_script = f''' Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing ... $handle = [IntPtr]{hwnd} ... $bitmap.Save("{output_path.replace(chr(92), chr(92)+chr(92))}") $bitmap.Dispose() Write-Output "OK" ''' result = subprocess.run( ['powershell', '-Command', ps_script], capture_output=True, text=True, encoding='utf-8' ) ``` These values originate from command-line arguments: ```python parser.add_argument('-w', '--window-title', default='金长江') parser.add_argument('-o', '--output') ... hwnd, title = find_window_by_title(args.window_title) ... screenshot_path = args.output or ... success = capture_window(hwnd, screenshot_path) ``` ### Technical Analysis The script constructs executable PowerShell source using Python formatted strings. Neither `title_pattern` nor `output_path` is safely encoded as a PowerShell string literal. Replacing backslashes in the path does not escape double quotes, dollar-expression expansion, backticks, statement se ...[truncated 1396 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
win_ocr_v2.py:30
Finding

PowerShell Injection Through Local OCR Image Paths

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
setup_ocr.py:30
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
simple_ocr.py:98
Finding

Cloud OCR Helpers Upload Arbitrary Images Without a Strong Data Boundary

Content
View full analysis
str: with open(image_path, 'rb') as f: return base64.b64encode(f.read()).decode('utf-8') ``` It then submits the encoded image to a selected cloud provider: ```python data = { 'image': image_base64, 'language_type': 'CHN_ENG' } response = requests.post(url, headers=headers, data=data) ``` ### Technical Analysis Base64 encoding is normal OCR API transport and is not encryption. The image contents remain available to the receiving cloud provider. Cloud OCR is declared by the Skill, so the network behavior is not a covert exfiltration channel. However, several helpers accept any user-supplied image rather than restricting transmission to the generated MA indicator crop. `simple_ocr.py` also defaults directly to OCR.space without an explicit per-upload confirmation. A financial-terminal screenshot may contain account identifiers, balances, holdings, wa ...[truncated 1300 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (169)

Tainted flow: 'url' from os.environ (line 18, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · debug_ocr.py (reported line 20)May include surrounding context.

python
secret_key = os.environ['BAIDU_SECRET_KEY']
url = f"https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={api_key}&client_secret={secret_key}"

with urllib.request.urlopen(url, timeout=10) as response:
    result = json.loads(response.read().decode())
    token = result['access_token']

Tainted flow: 'access_token' from os.environ.get (line 26, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · simple_ocr.py (reported line 48)May include surrounding context.

python
'language_type': 'CHN_ENG'
        }
        
        response = requests.post(
            f"{url}?access_token={access_token}",
            headers=headers,
            data=data,

Tainted flow: 'url' from os.environ (line 21, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · test_baidu_ocr.py (reported line 27)May include surrounding context.

python
import json

try:
    with urllib.request.urlopen(url, timeout=10) as response:
        result = json.loads(response.read().decode())
        if 'access_token' in result:
            token = result['access_token']

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Documentation that exposes window enumeration, PowerShell/WinAPI inspection, and writing a local window inventory broadens the skill's effective reconnaissance scope beyond the stated OCR task. On a user workstation, enumerating all visible windows can reveal unrelated sensitive application names or content context.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation lacks a clear warning that using Baidu OCR may send screenshot content to an external service. Because the source is a trading terminal, undisclosed off-device transfer is particularly dangerous and could expose sensitive financial data or workstation context.

Content

No source excerpt is available for this finding.