Summary
The Feishu extension in OpenClaw prior to version 2026.2.14 allowed the sendMediaFeishu tool to interpret attacker-controlled mediaUrl values as local filesystem paths and read them directly.
If an attacker can influence tool calls, including via prompt injection, they may supply sensitive paths such as /etc/passwd and cause the assistant to exfiltrate local files to Feishu.
Affected context
This vulnerability affects OpenClaw deployments that:
- Enable the Feishu integration and expose the
sendMediaFeishutool to workflows or user prompts - Run the assistant in an environment where the runtime has access to sensitive local files
- Allow user-controlled or model-influenced values to flow into the
mediaUrlparameter without strict validation
The issue is most concerning when the OpenClaw instance has access to configuration secrets, logs, SSH keys, or other confidential data on the local filesystem.
Exploit preconditions
- Attack surface: The Feishu
sendMediaFeishutool interface exposed through OpenClaw (e.g., chat, automations, or other tools). - Required access: Ability to influence tool invocation parameters, either:
- Directly (user explicitly sets
mediaUrl), or - Indirectly (prompt injection or compromised upstream data causing the model to choose an attacker-controlled
mediaUrl). - Trigger point: A call to
sendMediaFeishuwheremediaUrlis treated as a local filesystem path instead of a remote media URL. - Why exploitation is possible: The implementation trusted the
mediaUrlvalue and passed it directly to local file reading APIs without enforcing a whitelist of schemes, path restrictions, or confinement to a safe directory, enabling classic path traversal and arbitrary file read behavior.
Why this happens
The root cause is an insecure handling of path input coming from a potentially untrusted source, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Instead of validating that mediaUrl referred only to legitimate external media resources (e.g., HTTPS URLs) or restricting it to a dedicated media directory, the extension allowed arbitrary strings to be interpreted as paths on the local filesystem.
This design conflated "reference to media" with "path to file", failed to enforce a local root or scheme restrictions, and thus exposed sensitive files that the process could read.
Potential impact
- Disclosure of sensitive system files (e.g.,
/etc/passwd, configuration files, logs). - Exposure of application secrets such as API keys, database passwords, and OAuth tokens stored on disk.
- Leakage of private user data, including local documents or cached content accessible to the OpenClaw runtime.
- Facilitation of further attacks (lateral movement, account takeover) by exfiltrating credentials or internal configuration.
- Loss of confidentiality and potential regulatory or contractual violations due to data exfiltration via Feishu.
General mitigation guidance
Mitigation generally centers on strictly separating URL-like references from local file paths and minimizing what the assistant process can read:
- Enforce allowed schemes and patterns for
mediaUrl(e.g., onlyhttps://or other approved remote protocols) and reject values that look like absolute or relative filesystem paths. - Introduce a hardened media-loading layer that:
- Confines local file access (if needed at all) to a dedicated, non-sensitive directory.
- Implements canonicalization and checks that the resolved path stays under an allowed root.
- Normalizes and rejects paths containing traversal sequences (
.., symbolic links to sensitive areas, etc.). - Apply principle of least privilege to the OpenClaw runtime:
- Run with minimal filesystem permissions and avoid mounting secrets or sensitive directories unless strictly required.
- Use OS-level sandboxing or containers to limit accessible paths.
- Treat tool parameters as untrusted input, even when produced by the model, and validate them at the boundary of each extension.
- For sensitive environments, consider policy layers that prevent AI tools from initiating outbound transfers of arbitrary local content without explicit human review.
How teams detect issues like this
Detection typically involves both code-centric and behavior-centric approaches:
- Static analysis patterns:
- Search for calls where user- or model-influenced strings are passed directly into filesystem APIs (e.g.,
open,fs.readFile, similar equivalents) under parameters likeurl,path, orfilename. - Flag functions that accept something named
urlormediaUrlbut do not apply scheme checks, canonicalization, or root directory enforcement. - Look for path concatenation or direct interpolation without validation, especially in extensions that send data to external services.
- Code review signals:
- Any tool or plugin that can access the local filesystem and transmit content off the host (e.g., via HTTP, chat APIs, or messaging integrations).
- Mixed responsibilities where a "URL" parameter is sometimes treated as a remote URL and sometimes as a local file path.
- Absence of clear boundaries or wrappers around file access in the assistant's tool layer.
- Operational monitoring:
- Log and review all uses of tools that read local files and upload them externally; define alerts for unusual paths (e.g.,
/etc/,/home/,/var/log/). - Track anomalous file access patterns from the assistant process, especially reads of highly sensitive locations.
- Organizations may also employ automated code review or SAST tools configured with custom rules targeting path traversal and arbitrary file read patterns in AI tool integrations.

