Back to skill

Security audit

Local File

Security checks for vulnerabilities and agentic risk

Overview

This local file reader is purpose-aligned, but its weak path and size controls could let it read outside intended folders or overload the agent.

Review before installing. Use this only in a sandboxed workspace or after fixing path validation with canonical realpath containment, removing or explicitly configuring the hard-coded authorized directory, enforcing the documented file-size limit, and updating parser dependencies. Do not grant broad local-folder access unless you are comfortable with the agent reading supported files there.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
index.js:22
Finding

Allowed-Path Validation Can Be Bypassed to Read Unauthorized Files

Content
View full analysis
filePath.startsWith(root))) { return { error: '路径不在允许范围内' }; } // 根据扩展名选择读取方式 switch (ext) { case '.txt': case '.md': case '.json': return readTextFile(filePath); case '.docx': return await readDocx(filePath); case '.pdf': return await readPdf(filePath); default: return { error: '不支持的文件格式' }; } }; ``` ### Technical Analysis The authorization check applies `String.prototype.startsWith()` directly to an attacker-controlled path. It does not normalize or canonicalize the target before comparing it with an allowed root. This permits several forms of authorization bypass: - **Directory traversal:** A path such as `/workspace/../secret.json` begins with `/workspace` as a string but resolves outside that directory. - **Prefix collision:** If `/workspace` is allowed, a path such as `/workspace-backup/secret.txt` also passes the prefix check. - **Symbolic-link traversal:** A symbolic link located under the workspace can refer to a file outside it. The submitted path passes the string comparison while the filesystem resolves it to an unauthorized target. - **Undefined workspace behavior:** If `OPENCLAW_WORKSPACE` is unset, JavaScript converts the `undefined` search value to the string `"undefined"` when evaluating `startsWith(undefined)`. The implementation therefore does not reliably fail closed. - **Overly broad hard-coded authorization:** The fixed `D:\个人` root grants access independently of the configured workspace and withou ...[truncated 1670 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:4
Finding

Missing File-Size Enforcement Enables Resource-Exhaustion Attacks

Content
View full analysis
10MB)会拒绝 ``` ### Technical Analysis The documentation states that files larger than 10 MB will be rejected, but no file metadata or size validation is performed before reading or parsing. Text and PDF files are loaded completely into memory with `fs.readFileSync`. PDF processing then allocates additional memory during parsing. DOCX processing similarly parses a ZIP-based document through `mammoth`, which can consume substantially more memory than the compressed input size. The use of synchronous filesystem reads also blocks the Node.js event loop. A sufficiently large file, or a relatively small but parser-intensive document, can therefore degrade availability even when it does not terminate the process. No checks are present for: - Maximum compressed file size - Maximum extracted or parsed content size - Parser execution time - Maximum output length - Whether the target is a regular file - Concurrent parsing limits ### Attack Path 1. An attacker creates or identifies a large `.txt`, `.md`, `.json`, `.pdf`, or `.docx` file accessible to the skill. 2. The attacker invokes the skill with the file path. 3. The application performs no size check before processing th ...[truncated 1063 chars]
Remediation
View remediation
MAX_FILE_SIZE) { throw new Error('File exceeds the 10 MiB size limit'); } } ``` This check should run after canonical path authorization and before `readFile`, `extractRawText`, or PDF parsing. Because compressed and parser-intensive documents may expand significantly, the input-size check should be combined with execution-time, output-size, memory, and concurrency controls. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Known Vulnerable Dependency: @xmldom/xmldom==0.8.11 — 15 advisory(ies): CVE-2026-83608 (xmldom: DocType `name` Injection Bypasses requireWellFormed); CVE-2026-41673 (xmldom: Uncontrolled recursion in XML serialization leads to DoS); CVE-2026-83605 (xmldom: Attribute name injection via setAttribute() bypasses requireWellFormed) +12 more

High
Category
Supply Chain
Confidence
92% confidence
Finding

The lockfile pins @xmldom/xmldom 0.8.11 as a transitive dependency of mammoth, and the referenced advisories indicate parser/serializer weaknesses including input injection and denial-of-service conditions. In a local file manager skill that likely processes user-supplied DOCX/XML-derived content, this is materially relevant because crafted documents could trigger parser abuse or malformed XML handling.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: brace-expansion==1.1.12 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-33750 (brace-expansion: Zero-step sequence causes process hang and memory exhaustion); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
82% confidence
Finding

brace-expansion 1.1.12 is present as a transitive development dependency and the cited issues are denial-of-service conditions from pathological input expansion. Because it is only marked dev:true here and not part of the skill's runtime document-processing path, the practical exploitability in deployed skill use is limited, though it still represents a supply-chain weakness in build or tooling contexts.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: flatted==3.3.4 — 2 advisory(ies): CVE-2026-32141 (flatted vulnerable to unbounded recursion DoS in parse() revive phase); CVE-2026-33228 (Prototype Pollution via parse() in NodeJS flatted)

High
Category
Supply Chain
Confidence
80% confidence
Finding

flatted 3.3.4 appears only as a transitive development dependency under flat-cache/eslint tooling, and the advisories describe parse-time DoS and prototype pollution risks. As locked, this is a real vulnerable package version, but in this file's context it is less dangerous because it is not part of the core local-file parsing runtime and would mainly affect developer or CI environments.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
80% confidence
Finding

js-yaml 4.1.1 is included as a dev dependency through eslint configuration handling, and the advisories are primarily CPU-exhaustion issues during parsing of crafted YAML. This is a true vulnerable version, but the skill context makes it less dangerous because it does not appear to be used for runtime processing of untrusted content in the local file manager itself.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

All user-facing natural-language instructions and trigger descriptions are written exclusively in Chinese, which implies a fixed language/locale expectation. The file does not state that the skill is China-specific or provide any user opt-in or alternative language option.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation description lists generic phrases like “读取文件、查看文件、打开文件” without narrowing context or providing exclusions. These are common requests in everyday chat and could cause unintended invocation because the boundary between casual mention and deliberate skill use is unclear.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code includes natural-language comments and returned error strings exclusively in Chinese, such as the path and file-format error messages. The file does not offer any language selection or indicate that the skill is intentionally limited to Chinese-speaking users, which creates a locale-policy concern under the stated rules.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The package description is written only in Chinese, which indicates a language-specific presentation without any opt-in or alternative locale. Under the policy rules, forcing a specific language without user choice can be a natural-language policy violation unless the regional constraint is documented and justified.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Using a caret range for the mammoth dependency allows future minor/patch releases to be installed automatically, which can introduce supply-chain risk, unexpected behavior changes, or newly shipped malicious code if the dependency ecosystem is compromised. In a file-processing skill that parses untrusted documents, dependency integrity matters more because parser libraries are part of the attack surface.

Content

Scanner excerpt · package.json (reported line 26)May include surrounding context.

json
"node": ">=18.0.0"
  },
  "dependencies": {
    "mammoth": "^1.6.0",
    "pdf-parse": "^1.1.1"
  },
  "devDependencies": {

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Using a caret range for pdf-parse permits automatic adoption of newer releases without explicit review, increasing supply-chain exposure and the chance of pulling in vulnerable or malicious code. This is more sensitive here because PDF parsers process attacker-controlled files and are a common source of security bugs.

Content

Scanner excerpt · package.json (reported line 27)May include surrounding context.

json
},
  "dependencies": {
    "mammoth": "^1.6.0",
    "pdf-parse": "^1.1.1"
  },
  "devDependencies": {
    "eslint": "^8.56.0"

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · package.json (reported line 30)May include surrounding context.

json
"pdf-parse": "^1.1.1"
  },
  "devDependencies": {
    "eslint": "^8.56.0"
  },
  "openclaw": {
    "type": "skill",