T09 · Insecure Skill Coding Practices
- Location
scripts/convert.py:133- Finding
Response-Controlled Image URLs Enable Blind SSRF and Unbounded Downloads
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears purpose-built for OCR, but it uploads sensitive documents to a configured OCR service, keeps local archives by default, and has unsafe file/network handling that users should review before installing.
Review this skill carefully before installation, especially if you handle privileged legal, medical, financial, or evidence files. Use only a trusted PaddleOCR endpoint, understand that document contents may leave the machine, prefer limited page ranges, consider --no-archive for sensitive files, and avoid output paths where an existing *_images directory contains important data.
scripts/convert.py:133Response-Controlled Image URLs Enable Blind SSRF and Unbounded Downloads
scripts/convert.py:113Derived Image Output Directory Is Recursively Deleted Without Confirmation
scripts/convert.py:1Runtime Dependencies Are Loosely Constrained and Not Integrity-Locked
The documented behavior expands beyond the stated purpose by supporting remote file URLs and sending document contents to an external API using configured credentials, while the high-level description frames the skill as local OCR-to-Markdown processing. That mismatch can mislead users into exposing confidential legal or medical documents to third parties without informed consent.
The documented behavior expands beyond the stated purpose by supporting remote file URLs and sending document contents to an external API using configured credentials, while the high-level description frames the skill as local OCR-to-Markdown processing. That mismatch can mislead users into exposing confidential legal or medical documents to third parties without informed consent.
The documented behavior expands beyond the stated purpose by supporting remote file URLs and sending document contents to an external API using configured credentials, while the high-level description frames the skill as local OCR-to-Markdown processing. That mismatch can mislead users into exposing confidential legal or medical documents to third parties without informed consent.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
2. 进入对应模型的 API 页面
3. 在示例代码中复制:
- `API_URL`
- `Access Token`
### 配置方式
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
2. 进入对应模型的 API 页面
3. 在示例代码中复制:
- `API_URL`
- `Access Token`
### 配置方式
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cd paddle-ocr/config
cp .env.example .env
nano .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cd paddle-ocr/config
cp .env.example .env
nano .env
Referenced artifact was not completely inspected
/usr/bin/osascript -l JavaScript scripts/convert.js "/path/to/legal-document.pdf"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_config_path() -> Path:
return get_skill_root() / "config" / ".env"
def read_env_file(path: Path) -> dict[str, str]:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_config_path() -> Path:
return get_skill_root() / "config" / ".env"
def read_env_file(path: Path) -> dict[str, str]:
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
def get_runtime_config() -> dict[str, Any]:
file_env = read_env_file(get_config_path())
merged_env = {**file_env, **os.environ}
api_url = first_non_empty(merged_env, "PADDLEOCR_DOC_PARSING_API_URL")
access_token = first_non_empty(merged_env, "PADDLEOCR_ACCESS_TOKEN")
The skill documents capabilities that imply reading files, writing archives, using environment-based credentials, and making network calls, but it does not declare any explicit tool scope or permission boundaries. In an agent setting, missing scope declarations can cause overbroad access and make it harder for users or the runtime to understand that sensitive legal documents and tokens may be accessed and transmitted.
The skill description emphasizes OCR and archiving benefits but does not prominently warn that sensitive documents may be transmitted to an external OCR provider and retained locally by default. For legal, medical, and evidence materials, this omission materially increases the chance of inadvertent privacy, confidentiality, or compliance violations.
The documented workflow allows submitting document URLs to a remote parsing API, which broadens the trust boundary from local document conversion to externally fetched or relayed content. In the context of legal and medical records, this creates additional confidentiality, provenance, and SSRF-style risk surfaces if URLs are accepted without strong restrictions.
The documentation explicitly describes persistent archiving of the original input, extracted full text, images, batch artifacts, metadata, source path, and file hash, but provides no warning, consent flow, retention control, or privacy safeguards. In this skill’s context—legal PDFs, medical records, and evidence scans—the archived data is likely to contain highly sensitive personal, legal, or regulated information, so silent retention materially increases confidentiality and compliance risk.
The manifest describes a PaddleOCR skill for converting local PDFs/images to Markdown, but this wrapper implements that by constructing and executing shell commands via doShellScript, invoking /bin/zsh, dirname, uv, and Python. Spawning general shell commands is a broader capability than the stated OCR/Markdown conversion purpose and is not explicitly justified by the manifest text.
The script is presented as operating on local PDFs/images, but during image output handling it will fetch arbitrary remote URLs returned in OCR results via urllib.request.urlretrieve. This creates an unexpected outbound network path and can expose the host to SSRF-style access to internal resources or silent downloads from untrusted locations.
Remote download capability is not necessary for the stated local OCR conversion purpose and expands the attack surface. If the upstream parser or a crafted document can influence image references, the script may retrieve attacker-controlled content or access internal endpoints without the user's awareness.
The conversion flow sends document-derived content to an external OCR/parsing API through parse_document, yet the CLI does not provide an explicit warning or consent mechanism. In this skill's context—legal PDFs, medical records, and evidence scans—the transmitted data is likely highly sensitive, making undisclosed network exfiltration a significant privacy and compliance risk.
The script archives the original input, extracted markdown, images, and metadata by default unless --no-archive is supplied. For a skill intended for legal case files, medical records, and evidence documents, silent retention of sensitive materials on disk materially increases confidentiality, forensic, and compliance exposure if the machine is shared or later compromised.
Manifest 说明技能“默认将本地 PDF 或图片转换为 Markdown”,但该调用脚本的稳定输出是 JSON envelope,并且默认写入 .json 文件。虽然底层解析结果可能间接包含 Markdown,但从该文件可见的实际接口行为与“默认输出 Markdown”不一致。
Manifest 描述强调默认处理本地 PDF 或图片,并未说明该技能还可接收远程文件 URL。此脚本通过 --file-url 暴露远程输入能力,属于对外部资源访问的额外行为,与面向本地文档 OCR 的描述存在语义偏差。
The script writes OCR results by default into a predictable temp-directory subtree without explicit user acknowledgement, which can persist sensitive legal, medical, or evidentiary data on disk. In the context of this skill, the extracted content is likely highly sensitive, so silent persistence increases the risk of local disclosure, retention beyond user intent, and accidental exposure to other processes or operators with filesystem access.
The file contains multiple natural-language strings presented to users exclusively in Chinese, such as configuration and runtime error messages. Because no language selection, opt-in, or documented region-specific justification is provided, this creates a language/locale policy issue.
This code sends the assembled payload to a remote API, and that payload can include either a base64-encoded local document or a user-supplied file URL. The file contains no confirmation prompt, print/log disclosure, or comment/docstring warning that document data will be transmitted to an external service.