T09 · Insecure Skill Coding Practices
- Location
ocr.py:21- Finding
Unrestricted API Endpoint Override Can Expose Credentials and Local Images
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This OCR skill is mostly purpose-aligned, but it needs review because it can send local images and an API key to a configurable remote endpoint.
Review this skill before installing. Only use it with images you are comfortable sending to OpenRouter or another configured provider, avoid sensitive documents unless approved, keep the API key scoped and limited, and do not allow untrusted users or wrappers to set OCR_BASE_URL.
ocr.py:21Unrestricted API Endpoint Override Can Expose Credentials and Local Images
SKILL.md:10Unpinned Third-Party Dependencies Create a Non-Reproducible Supply-Chain Risk
The skill documentation describes OCR functionality that sends user-supplied prompts and image content to OpenRouter, but it does not clearly warn users that their data leaves the local environment and is transmitted to a third-party API. This can cause unintended disclosure of sensitive images, documents, or embedded secrets, especially because the skill also supports local file paths that users may assume are processed locally.
The script attempts to read an API key from a hardcoded secrets path under the Administrator profile, which reaches into local sensitive storage unrelated to user input. In an agent-skill context, this is dangerous because it expands the skill’s access to local credentials and may enable unauthorized use of secrets or normalize secret harvesting behavior.
The code transmits either an image URL or full base64-encoded local image contents to a third-party remote API without any explicit user warning or consent flow. This can leak sensitive documents, screenshots, IDs, or other private image data, and the risk is heightened because the tool also performs non-OCR analysis beyond what its name implies.
The file name, CLI help, and prompt variable describe the tool as OCR-oriented, but the code explicitly performs an additional first step to 'describe the image' using a detailed scene-description prompt before OCR. This is not merely omitted detail in comments: the inline comments at L97 and L102 separate two distinct behaviors, showing the script does broader image analysis than OCR alone.
The script sends user-supplied image data to a third-party OCR service at the configured external API endpoint without any explicit consent prompt, warning, or data-handling notice. If the image contains sensitive information such as IDs, financial records, medical data, or proprietary documents, this causes unintended disclosure to an external processor and may violate privacy, policy, or compliance requirements.
The script transmits either a user-supplied image URL or the full contents of a local image file to an external OCR service without any explicit consent prompt, warning, or data-handling disclosure. This can expose sensitive images or embedded personal/confidential information to a third-party provider, especially because local files are base64-encoded and sent off-host automatically.
The skill hardcodes Chinese natural-language defaults such as the OCR prompt and example output text, which implies a specific language/locale preference without user opt-in or explanation. This can conflict with language/locale policy expectations when a skill is otherwise presented as general-purpose.
The script hardcodes Chinese-language default prompts and instructions such as OCR提取图片所有文字 and 请详细描述这张图片的内容... with no opt-in or language selection. This can violate language/locale policy when a skill implicitly forces a specific language for all users.
The script accesses sensitive credentials by reading an API key from a fixed local secrets path and then from an environment variable. There is no comment or user-facing notice in the executable flow explaining that credentials will be loaded from these sources, which falls under undisclosed access to sensitive environment variables or credentials.