CVE-2026-25475: OpenClaw Vulnerable to Local File Inclusion via MEDIA: Path Extraction
OpenClaw's media parser accepts any local path in a MEDIA: token, so an agent reply such as MEDIA:~/.ssh/id_rsa makes the gateway stage that file and send it to the user or channel. The flaw affects openclaw up to 2026.1.29 per the package data. The package data names 2026.1.30 as patched; the advisory page now lists 2026.2.1, so upgrade to 2026.2.1 or later.
Published Feb 4, 2026 · Analysis Nov 1, 2026
What an attacker can do
isValidMedia() in src/media/parse.ts returns true for any candidate that starts with /, ./, ../ or ~. Nothing checks that the path sits in a safe directory or even points to a media file. When the agent's output contains MEDIA:/etc/passwd, MEDIA:~/.aws/credentials or MEDIA:../../../etc/passwd, OpenClaw copies the file into the outgoing message and delivers the contents to the requesting user or channel.
The agent's output is the trigger, so anyone who can steer the agent can read files. That includes a user with a low-privilege account on a shared bot, and an attacker who plants instructions in content the agent reads (prompt injection). The CVSS vector asks for low privileges and no user interaction.
The agent can read any file its OS user can read: SSH private keys, cloud credentials, .env files and API keys in config.json, and system files. In a group chat or channel, the contents are visible to everyone there.
Who is affected
The npm package openclaw. Package data lists versions up to 2026.1.29 as vulnerable, with 2026.1.30 patched. The GitHub advisory page lists versions up to 2026.1.30 as affected and 2026.2.1 as patched, so treat 2026.1.30 as unsafe. Check the version:
npm ls -g openclawExposure is highest where the agent runs as a user that can read secrets and answers people who are not the owner.
openclaw
- Ecosystem
- npm
- Affected
- <= 2026.1.29
- Fixed in
- 2026.1.30
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.2.1 or later. The advisory page names 2026.2.1 as patched, while the package data names 2026.1.30. Using 2026.2.1 or later satisfies both.
npm install -g openclaw@latestThe fix (commit 34e2425b4d92e8aa8c3fdf11d5dc6b49d5849abb, PR 4930) restricts local inbound media staging to the OpenClaw media directory. The advisory's workaround for those who cannot upgrade: run OpenClaw as a least-privilege user that cannot read sensitive files. Rotate any credentials the agent user could read if you suspect abuse.
How to tell if you were hit
Search agent transcripts and channel history for MEDIA: tokens that point at paths outside the OpenClaw media directory, especially /etc, ~/.ssh, ~/.aws, .env and ../ sequences. Check chat channels for messages that contain key material or credential files. Review file-access logs for reads of sensitive files by the OpenClaw process. Beam records agent file access, and its rules can flag reads of SSH keys and cloud credential files.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
The isValidMedia() function in src/media/parse.ts allows arbitrary file paths including absolute paths, home directory paths, and directory traversal sequences. An agent can read any file on the system by outputting MEDIA:/path/to/file, exfiltrating sensitive data to the user/channel.
Details
Location: src/media/parse.ts:17-27
The path validation accepts dangerous patterns:
function isValidMedia(candidate: string, opts?: { allowSpaces?: boolean }) {
if (candidate.startsWith("/")) return true; // ALLOWS /etc/passwd
if (candidate.startsWith("./")) return true;
if (candidate.startsWith("../")) return true; // ALLOWS ../../etc/passwd
if (candidate.startsWith("~")) return true; // ALLOWS ~/secrets
return false;
}No validation ensures the path is within a safe directory or is actually a media file.
PoC
Agent outputs any of:
MEDIA:/etc/passwd
MEDIA:~/.ssh/id_rsa
MEDIA:~/.aws/credentials
MEDIA:../../../etc/passwdThe file contents are rendered/sent to the requesting user or channel.
Impact
- Read ANY file accessible to the agent user
- Exfiltrate SSH keys (
~/.ssh/id_rsa) - Steal cloud credentials (
~/.aws/credentials) - Access API keys (
.env,config.json) - Read system files (
/etc/passwd,/etc/shadow)
Note: PR #4930 contains a fix but is NOT MERGED - production is vulnerable.
Credited to jasonsutter87, evanotero.
Questions
- What do I need to exploit CVE-2026-25475?
The ability to make the agent output a MEDIA: token with a chosen path. That can be a user of the bot, or prompt injection through content the agent reads. The vector asks for low privileges.
- Which version is the fix?
The package data says 2026.1.30. The advisory page lists 2026.2.1 and marks 2026.1.30 as still affected. Upgrade to 2026.2.1 or later.
- Can it read files outside the project?
Yes. Any file the OpenClaw user can read is reachable, including home directory paths and absolute paths.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More OpenClaw vulnerabilities
All OpenClaw entriesCVE-2026-62197
OpenClaw: Browser CDP discovery could accept blocked WebSocket URLs
medium8.5Oct 21, 2026CVE-2026-35630
OpenClaw: QQBot native approval buttons did not enforce configured approver identity
high8.0Jul 2, 2026CVE-2026-53806
OpenClaw: Combined POSIX shell options could confuse exec revalidation
high8.8Jul 2, 2026CVE-2026-53809
OpenClaw: Embedded runner policy could be confused by provider aliases
medium3.8Jul 2, 2026CVE-2026-53810
OpenClaw's marketplace runtime extension metadata could point at unscanned payloads
high8.8Jul 2, 2026CVE-2026-53811
OpenClaw: Matrix allowFrom could bind to mutable display names
high8.8Jul 2, 2026
