T09 · Insecure Skill Coding Practices
- Location
scripts/extract.py:539- Finding
Unrestricted Custom API Endpoint Can Receive Credentials and Document Contents
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a legitimate shipping-document extraction skill, but it needs Review because it can send sensitive documents and API credentials to unvalidated external AI endpoints and auto-read local OpenClaw auth profiles.
Install only if you are comfortable with booking documents, including commercial and personal shipping details, being sent to the configured AI provider. Use a trusted provider endpoint, avoid setting OPENAI_BASE_URL to an untrusted host, review OpenClaw auth-profile access, and use an isolated environment with pinned dependencies for sensitive workflows.
scripts/extract.py:539Unrestricted Custom API Endpoint Can Receive Credentials and Document Contents
scripts/extract.py:327Untrusted Document Instructions Can Manipulate AI-Generated Extraction Results
requirements.txt:1Third-Party Dependencies Are Installed Without Version or Integrity Pinning
The skill declares shell, file-read, and environment-dependent behavior but does not define an explicit tool/permission scope. That creates unnecessary privilege ambiguity: an agent may execute commands, read local files, or access API keys beyond the minimum needed, increasing the blast radius if the skill is mis-triggered or its downstream script behaves unexpectedly.
The skill explicitly routes document content to third-party model endpoints, so uploaded booking documents may leave the local environment and be processed by external providers. Because booking files commonly contain commercial and personal data, unintended disclosure can occur if users are not clearly gated, if tenant-approved endpoints are not enforced, or if the skill is triggered on the wrong file.
|------|------|
| ✅ 推荐 | 在 OpenClaw 中已配置 AI 账号,**自动读取,无需任何操作** |
| Anthropic Claude | `export ANTHROPIC_API_KEY=your_key` |
| DeepSeek | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://api.deepseek.com/v1` |
| 通义千问 | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1` |
| Kimi | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://api.moonshot.cn/v1` |
| 智谱 GLM | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://open.bigmodel.cn/api/paas/v4` |
This finding reflects another third-party endpoint option for transmitting extracted document content to an external AI service. In this skill’s context, the danger is not the specific provider string itself but the designed behavior of sending potentially sensitive shipping instructions to outside services, which increases confidentiality and compliance risk.
| Anthropic Claude | `export ANTHROPIC_API_KEY=your_key` |
| DeepSeek | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://api.deepseek.com/v1` |
| 通义千问 | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1` |
| Kimi | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://api.moonshot.cn/v1` |
| 智谱 GLM | `export OPENAI_API_KEY=your_key` `export OPENAI_BASE_URL=https://open.bigmodel.cn/api/paas/v4` |
| 自定义文本模型 | `export SHIPPING_MODEL=your_model_name` |
| 自定义视觉模型 | `export SHIPPING_VISION_MODEL=your_vision_model`(用于图片/PDF) |
The trigger list includes generic terms such as “解析”, “识别”, and “extract”, which are common in many unrelated file-processing requests. This can cause unintended activation on non-booking documents, leading the skill to run extraction logic and potentially transmit unrelated uploaded content to external AI APIs.
This markdown file contains all instructional content in Chinese and does not provide an English alternative, opt-in, or justification that the skill is intentionally limited to a Chinese-speaking or region-specific workflow. That can violate language/locale policy because it effectively forces one language for users consuming the skill documentation.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
with tempfile.NamedTemporaryFile(suffix='.txt', delete=False) as tmp:
tmp_path = tmp.name
try:
result = subprocess.run(
['textutil', '-convert', 'txt', '-output', tmp_path, file_path],
capture_output=True, text=True, timeout=30
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 非 macOS:尝试 LibreOffice headless
try:
with tempfile.TemporaryDirectory() as tmp_dir:
result = subprocess.run(
['libreoffice', '--headless', '--convert-to', 'txt:Text', '--outdir', tmp_dir, file_path],
capture_output=True, text=True, timeout=60
)
The code sends extracted text and document images to third-party AI providers, which may include sensitive commercial and personal shipping data, without any explicit warning or confirmation step. In this skill context, booking instructions commonly contain consignee/shipper identities, addresses, cargo details, and routing information, so silent external transmission materially raises confidentiality risk.
Untrusted document text is concatenated directly into the same prompt that contains extraction instructions, so instruction-like content inside the booking document can semantically steer the model. In practice, this can cause incorrect extraction, refusal, fabricated JSON, or attempts to override the intended schema, reducing integrity and reliability of downstream structured data.
The PDF path mixes extraction instructions, text-layer content, and page images in a single multimodal prompt. A malicious PDF can embed natural-language directives in either text or visible content that influence the model's interpretation, making output integrity especially fragile for scanned forms and adversarial layouts.
The skill claims to process uploaded booking documents, but it also reads local OpenClaw authentication files to discover API credentials automatically. That expands its access beyond the user-provided file set and can surprise users, especially in a document-processing tool that has no obvious need to inspect unrelated local config data.
Accessing unrelated local authentication material is outside the minimum privileges required for extracting booking data from uploaded files. Even if the code only uses the keys for outbound API calls, the capability itself increases the blast radius of compromise and violates least-privilege expectations for this skill.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
]
# OpenAI 兼容的国产模型 base_url 映射
OPENAI_COMPAT_PROVIDERS = {
"deepseek": "https://api.deepseek.com/v1",
"qwen": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"moonshot": "https://api.moonshot.cn/v1",
"zhipu": "https://open.bigmodel.cn/api/paas/v4",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
]
# OpenAI 兼容的国产模型 base_url 映射
OPENAI_COMPAT_PROVIDERS = {
"deepseek": "https://api.deepseek.com/v1",
"qwen": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"moonshot": "https://api.moonshot.cn/v1",
"zhipu": "https://open.bigmodel.cn/api/paas/v4",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
OPENAI_COMPAT_PROVIDERS = {
"deepseek": "https://api.deepseek.com/v1",
"qwen": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"moonshot": "https://api.moonshot.cn/v1",
"zhipu": "https://open.bigmodel.cn/api/paas/v4",
"openai": None, # 官方 OpenAI,无需自定义 base_url
}
This call path passes text derived from rich documents into the same prompt channel used for tasking the model. Since office documents can contain hidden or non-obvious natural-language content, an attacker could embed paraphrased jailbreak or behavior-redirecting instructions that static keyword matching would miss.
The dependency list leaves anthropic unpinned, so builds may install different versions over time, including versions with known security defects or breaking behavior. In a file-processing skill that handles untrusted user uploads, dependency drift increases supply-chain risk and makes it impossible to verify whether a safe release is installed.
anthropic
openai
pdfplumber
pymupdf
The manifest does not pin anthropic, so it is impossible to determine whether deployment will use a version affected by known advisories. Even though this package is not a document parser, known SDK flaws combined with version ambiguity create avoidable supply-chain and runtime risk.
The openai package is unpinned, which makes installations non-reproducible and can silently introduce vulnerable or incompatible versions. Although this is not direct code execution by itself, it weakens supply-chain integrity and operational assurance.
anthropic
openai
pdfplumber
pymupdf
python-docx
pdfplumber is unpinned, allowing arbitrary future releases to be installed during deployment. Because this skill parses uploaded documents, parser-library changes can introduce exploitable bugs or unsafe defaults without notice.
anthropic
openai
pdfplumber
pymupdf
python-docx
openpyxl
PyMuPDF is unpinned despite known advisories existing for some releases, so the deployment may resolve to an affected version without visibility. This is more concerning here because the skill ingests attacker-controlled PDFs and images, making document-parser vulnerabilities more relevant than in a non-file-processing tool.
anthropic
openai
pdfplumber
pymupdf
python-docx
openpyxl
xlrd
PyMuPDF has known advisories and the requirements file does not pin a version, so an affected release could be installed unknowingly. This is especially dangerous in this skill because PyMuPDF processes untrusted uploaded documents, making parser/path-handling flaws directly reachable through expected user inputs.
python-docx is unpinned even though older releases have had XML external entity-related issues. Since this skill processes uploaded Office-style documents from users, leaving the parser version uncontrolled increases the chance of exposing the service to file-based attacks.
openai
pdfplumber
pymupdf
python-docx
openpyxl
xlrd
striprtf
python-docx has known XXE-related advisories, and without version pinning there is no assurance the deployed environment uses a patched release. Because this skill accepts user-provided document files, a vulnerable XML parser could potentially be exploited via crafted DOCX content during normal operation.
openpyxl is unpinned and historical versions have had XXE-related vulnerabilities. In a workflow that parses user-supplied spreadsheet files, this elevates the practical risk because a vulnerable parser could be reached directly through normal skill usage.
pdfplumber
pymupdf
python-docx
openpyxl
xlrd
striprtf
No suspicious patterns detected.