T09 · Insecure Skill Coding Practices
- Location
debug_ocr.py:12- Finding
Hard-Coded Baidu OCR Credentials Exposed in Source Code and Documentation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
debug_ocr.py:12Hard-Coded Baidu OCR Credentials Exposed in Source Code and Documentation
simple_ocr.py:98Embedded Shared OCR.space API Key
setup_ocr.py:12Shell Command Injection Through OCR Credential Configuration
capture_ma20_powershell.py:34PowerShell Injection Through Window Title and Screenshot Output Path
win_ocr_v2.py:30PowerShell Injection Through Local OCR Image Paths
setup_ocr.py:30Unpinned Third-Party Dependency Installation
simple_ocr.py:98Cloud OCR Helpers Upload Arbitrary Images Without a Strong Data Boundary
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
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']
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
'language_type': 'CHN_ENG'
}
response = requests.post(
f"{url}?access_token={access_token}",
headers=headers,
data=data,
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
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']
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.