T05 · Unauthorized Access and Privilege Escalation
- Location
index.js:1749- Finding
Arbitrary Local Image and PDF Disclosure Through Untrusted Context Paths
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This OCR skill is coherent and mostly disclosed, but it needs Review because its file/context handling and optional remote attachment flow can expose sensitive documents or credentials if used in a permissive integration.
Install only if you trust the configured OCR/multimodal providers and understand that document contents may be sent to them. Keep Feishu auto-send, remote input, and OpenClaw session recovery disabled unless needed; avoid using this in shared or untrusted chat integrations until local file paths are restricted to trusted upload directories, remote downloads use an allowlist without ambient auth headers, redirects/DNS are validated, and config.json secrets are protected with owner-only permissions.
index.js:1749Arbitrary Local Image and PDF Disclosure Through Untrusted Context Paths
index.js:1820Authorization Headers and Cookies Can Be Forwarded to Attacker-Controlled Attachment Hosts
index.js:1912Remote Attachment SSRF Protection Is Bypassable Through DNS and Redirects
update-config.js:42API Tokens Are Persisted Without Restrictive File Permissions
The description focuses on OCR/Markdown generation, but the documented behavior also includes recovering session/recipient information from runtime files and environment variables, parsing message context including headers/auth-related fields, downloading remote attachments, and invoking another skill to send files. These extra behaviors materially expand the trust boundary and can expose sensitive metadata, enable data exfiltration, or trigger cross-skill actions that a user may not expect from an OCR skill.
The description focuses on OCR/Markdown generation, but the documented behavior also includes recovering session/recipient information from runtime files and environment variables, parsing message context including headers/auth-related fields, downloading remote attachments, and invoking another skill to send files. These extra behaviors materially expand the trust boundary and can expose sensitive metadata, enable data exfiltration, or trigger cross-skill actions that a user may not expect from an OCR skill.
The description focuses on OCR/Markdown generation, but the documented behavior also includes recovering session/recipient information from runtime files and environment variables, parsing message context including headers/auth-related fields, downloading remote attachments, and invoking another skill to send files. These extra behaviors materially expand the trust boundary and can expose sensitive metadata, enable data exfiltration, or trigger cross-skill actions that a user may not expect from an OCR skill.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
return false;
}
return promptText === DEEPSEEK_PROMPTS.handwriting || HANDWRITING_KEYWORD_REGEX.test(promptText);
}
function stripMarkdownSyntax(line) {
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
process.exit(missingFields.length === 0 ? 0 : 1);
}
const hasVisionEnv = Object.keys(process.env).some(name => name.startsWith('VISION_'));
if (!forceUpdate && !hasVisionEnv) {
log('未检测到任何 VISION_* 环境变量,未改写本地配置。', 'WARN');
console.log('\n如需写入本地 config.json,请先设置对应的 VISION_* 环境变量,再运行该命令。');
文件从开头起即以中文描述技能能力,通篇示例、参数说明和使用说明也全部使用中文,但没有说明这是面向特定中文用户群的区域性技能,也没有提供其他语言或用户选择。根据规则,强制特定语言而无用户选择或合理限定,属于自然语言层面的语言/区域策略风险。
The skill documentation declares capabilities involving environment variables, networked OCR/multimodal services, runtime session recovery, and optional Feishu delivery, but it does not define any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity: a host may grant broader-than-necessary env/network access, increasing the chance of unintended data exposure or misuse if the skill is invoked in a permissive environment.
The trigger examples include broad natural-language phrases such as 'OCR 这个截图' and '识别图片', which can overlap with ordinary conversation and cause accidental activation. In a skill that may access files, perform network requests, infer recipients, and optionally send results outward, unintended triggering raises the risk of processing or disclosing sensitive documents without sufficiently deliberate user intent.
The code infers delivery recipients from OPENCLAW_* environment variables and from ~/.openclaw/runtime.json, then uses that identity to route recognized document contents to Feishu. This creates a cross-context data exposure risk: OCR results from one invocation may be sent to an unintended user or group if runtime metadata is stale, poisoned, or incorrectly populated.
The skill can discover remote attachment URLs from message/context objects and, when enabled, automatically download them with optional Authorization/Cookie/Referer headers inherited from runtime context. This expands the trust boundary from user-provided local files to network retrieval and can be abused for unintended outbound requests, sensitive header leakage to third-party hosts, and processing attacker-controlled remote content.
The package description is written entirely in Chinese and presents the skill behavior in a single locale without indicating user choice or multilingual support. This may violate language/locale policy if the skill is expected to operate in a user-selected language rather than implicitly defaulting to Chinese.
The manifest advertises optional automatic sending to Feishu, but the description does not prominently warn that recognized document contents may be transmitted to an external chat destination. For an OCR skill handling screenshots, scans, invoices, and technical documents, this raises meaningful confidentiality and privacy risks if users do not clearly understand where extracted data will go.
The contains-match trigger "识别" is extremely generic for Chinese-language conversations and can activate the skill in many contexts unrelated to OCR. In a skill that can process documents and optionally transmit extracted content to Feishu, unintended activation increases the chance of accidental data handling or disclosure.
The contains trigger "OCR" is broad and likely to match routine discussion about OCR rather than explicit requests to run this skill. This can cause unintended invocation of a capability that sends content to external OCR/multimodal services, creating unnecessary exposure of user data.
The trigger "截图" is ambiguous because users may mention screenshots conversationally without requesting OCR. By itself this is less dangerous than a direct send action, but in this skill context it can still lead to accidental processing of image content by remote services.
The contains trigger "PDF" is overly broad because users frequently mention PDFs without asking for OCR or document conversion. In this skill, broad PDF-triggered activation can cause unintended ingestion of potentially sensitive documents and transmission to configured OCR/multimodal endpoints.
The skill documentation and usage instructions consistently assume Chinese, but there is no statement that the skill supports multiple languages or that Chinese is an intentional, user-selected locale. This can violate language/locale policy when users are not given a choice or informed of the constraint.
The placeholder strings for the configuration fields are written entirely in Chinese, which imposes a specific language/locale in user-facing natural language content. The file does not offer an alternative language choice or document a justified region-specific constraint.
The code formats recognition timestamps with toLocaleString('zh-CN'), which forces a specific language/locale in user-visible output. This is a natural-language locale choice embedded in the skill and does not appear to offer user opt-in or configuration.
The generated markdown for OCR-only results includes a timestamp produced with toLocaleString('zh-CN'), forcing Chinese locale formatting. The file does not show a user-selectable language/locale option for this user-facing text.
The generated markdown for image results uses toLocaleString('zh-CN'), which imposes a specific locale in output formatting. This is a language/locale policy issue because no opt-in or documented locale constraint is present in the file.
The comment states robot mode 'only trusts explicit recipients or current context.session' to avoid additional runtime-file-based recipient inference. However, the actual logic also parses recipient overrides from free-form user text and later passes that recipient into delivery logic, so the documented trust model is narrower than the implemented behavior.
This manifest file contains only a broad capability description of the OCR skill and does not indicate how or when it should be invoked, nor any constraints or exclusion conditions. In manifest-style metadata, the absence of trigger specificity can contribute to unintended invocation if downstream tooling uses the description as activation guidance.
This code writes PNG files to paths derived from user input, but the function contains no confirmation prompt, comment/docstring, or user-facing disclosure about creating files. For a code file, file writes are safety-relevant operations that should have some visible warning unless the operation is clearly documented elsewhere, which is not present in this file.
The optimize_image path saves a transformed image to the provided output path, but there is no confirmation prompt, comment/docstring, or user-facing notice describing that a file will be written. This is a safety-critical file-write operation under the rule's code-file criteria.
Detected: suspicious.dangerous_exec, suspicious.env_credential_access