T09 · Insecure Skill Coding Practices
- Location
scripts/convert-bg.mjs:67- Finding
AppleScript Injection Through an Attacker-Controlled Filename
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This document-conversion skill is coherent, but needs review because it sends documents through a third-party API path, reads a shared credential file as a fallback, and has a macOS notification bug that can run unintended commands from crafted filenames.
Review before installing. Use it only for documents you are comfortable sending to a remote AI provider and the APIYI intermediary, prefer an explicitly supplied APIYI_API_KEY over a shared credential file, avoid background conversion on untrusted filenames on macOS, and pin or audit the zerox dependency before relying on it for sensitive files.
scripts/convert-bg.mjs:67AppleScript Injection Through an Attacker-Controlled Filename
README.md:7Document and Credential Traffic Redirected Through a Third-Party API Intermediary
scripts/convert.mjs:40Unnecessary Read Access to the Shared OpenClaw Credential File
package.json:1Unpinned Security-Sensitive Dependency Without a Lockfile
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
这里配置的是API易的apiKey
echo 'APIYI_API_KEY = sk-xxx' >> ~/.openclaw/.env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
### 配置apiKey
这里配置的是API易的apiKey
```sh
echo 'APIYI_API_KEY = sk-xxx' >> ~/.openclaw/.env
```
This finding corresponds to the code path that intentionally looks for API credentials outside the immediate execution environment. While it appears to be for service authentication rather than exfiltration, accessing ~/.openclaw/.env is still credential access behavior that is unnecessary to perform basic file handling and increases exposure of local secrets.
process.exit(1);
}
// Read API key from ~/.openclaw/.env if not in environment
let apiKey = (process.env.APIYI_API_KEY ?? "").trim();
if (!apiKey) {
At this line the script constructs a path to ~/.openclaw/.env and reads it directly, which is a concrete credential-access operation. Even if the intent is convenience, direct reading of a secrets file by a skill broadens trust requirements and could enable unauthorized use of stored API keys.
if (!apiKey) {
try {
const envPath = path.join(process.env.HOME || "~", ".openclaw", ".env");
const envContent = fs.readFileSync(envPath, "utf-8");
const match = envContent.match(/APIYI_API_KEY\s*=\s*(.+)/);
if (match) {
The README instructs users to alter a dependency so document contents and API requests are sent through a third-party proxy endpoint rather than the original provider path. For a document-conversion skill, this materially changes the trust boundary: potentially sensitive documents and prompts may be transmitted to an external intermediary with unknown security, retention, and access controls.
Directing users to modify dependency source code to reroute traffic to a third-party endpoint bypasses normal package integrity and update expectations, and does so without warning about the security consequences. This creates supply-chain and transparency risks because users may unknowingly process sensitive documents through an intermediary outside the documented behavior of the original library.
The documented endpoint indicates that document-processing data may be transmitted to an external service. In the context of a skill advertised as converting local documents to Markdown, external transmission is more dangerous because users may provide confidential PDFs, DOCX files, or scanned records without realizing they are leaving the local environment.
npm install zerox --ignore-scripts
### 修改zerox源码
由于直连zerox只支持国外的几个模型厂商,直连连不上,所以需要用中转商,这里用的是API易,需要把node_modules目录下的zerox源码的openAI.js文件中的API端点地址改为 https://api.apiyi.com/v1
### 配置apiKey
这里配置的是API易的apiKey
The README tells users to place an API key into a local env file but provides no guidance on file permissions, secret rotation, avoiding source control exposure, or use of a secure secret store. While not immediate exfiltration on its own, this encourages weak credential hygiene that can lead to accidental disclosure or misuse of the proxy account.
The skill invokes Node scripts and requires an environment variable containing an API key, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens the trust boundary for the skill, making its runtime capabilities less transparent to users and policy enforcement, and can lead to unintended access to sensitive environment data or code execution pathways.
The skill processes user-supplied documents with GPT-4o vision via an external AI API, but the description does not clearly warn that document contents will be transmitted off-box to a third-party service. This creates a significant data privacy and compliance risk because users may submit sensitive files without informed consent, especially given the skill's broad support for PDFs, DOCX, PPTX, and images.
The manifest describes a document-to-Markdown conversion skill for text extraction. While spawning the converter itself is an expected implementation detail, invoking osascript to execute AppleScript and interact with the host notification system adds an unrelated system-automation capability outside the declared document-processing purpose.
The script reads an API key from ~/.openclaw/.env when the environment variable is absent, which expands its access to sensitive local credential material beyond the immediate user input and declared document path. For a document-conversion skill, silently probing a home-directory secrets file is risky because it normalizes credential harvesting behavior and can expose credentials to code paths or logs that were not expected by the user.
The script sends the provided document to an external model provider through zerox/OpenAI without any explicit user-facing notice or consent prompt about off-device transmission. This is dangerous because users may supply sensitive PDFs, DOCX, or images expecting local conversion, causing confidential content to be disclosed to a third party unintentionally.
The dependency uses a caret range (^1.1.20), which allows automatic installation of newer compatible versions instead of a single reviewed version. This increases supply-chain risk because future package releases could introduce malicious code, vulnerable transitive dependencies, or breaking behavior without an explicit update review. In a document-conversion skill that processes untrusted files, dependency trust is more security-sensitive than in a purely local utility.
{
"dependencies": {
"zerox": "^1.1.20"
}
}
Detected: suspicious.dangerous_exec