GHSA-g2f6-pwvx-r275: OpneClaw accepts unsanitized iMessage attachment paths which allowed SCP remote-path command injection
OpenClaw up to and including 2026.3.12 passed iMessage attachment paths to scp without checking them for shell metacharacters. A sender-controlled attachment filename could run commands on the configured remote attachment host when remote staging was enabled. Fixed in openclaw 2026.3.13, which validates the path before it starts scp.
Published Mar 16, 2026 · Analysis Oct 31, 2026
What an attacker can do
In src/auto-reply/reply/stage-sandbox-media.ts, when ctx.MediaRemoteHost is set, OpenClaw stages the attachment by spawning /usr/bin/scp with the operand remoteHost:remotePath. The host was normalized, but the path was not. scp hands the remote part to a shell on the far side, so characters such as ; | $ or backticks in the path run as commands there (CWE-78).
The attacker is anyone who can send an iMessage to an account OpenClaw reads. They name the attachment file with shell metacharacters. No login to OpenClaw and no click by the owner is needed, but remote attachment staging must be switched on and a remote host configured. The CVSS vector marks that as an attack precondition.
The commands run on the remote attachment host, typically a Mac that holds the Messages database, as the account used for the SCP connection. That can expose messages, files and any keys on that host. It also crosses from untrusted chat content into code execution on a machine outside the OpenClaw host. Setups that do not use MediaRemoteHost do not take this path.
Who is affected
The npm package openclaw up to and including 2026.3.12, where iMessage remote attachment staging over SCP is enabled (ctx.MediaRemoteHost set). Check the version:
npm ls openclaw
openclaw --versionCheck your configuration for a remote attachment host in the iMessage setup.
openclaw
- Ecosystem
- npm
- Affected
- <= 2026.3.12
- Fixed in
- 2026.3.13
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.3.13:
npm install -g [email protected]The fix commit a54bf71 adds normalizeScpRemotePath(...). It rejects paths that are not absolute, that contain control characters, or that contain a backslash, quotes, a backtick, $, ;, |, & , < or >. scpFile then throws "invalid remote path for SCP" before it spawns scp. The sources name no workaround. Until you upgrade, turn off remote attachment staging, or restrict who can message the account.
How to tell if you were hit
On the remote attachment host, check shell history, auth logs and process listings for commands that started from the SCP session user around the time attachments arrived. In the iMessage store, look for attachment filenames that contain ;, |, $( or backticks. After the upgrade, OpenClaw logs an error with "invalid remote path for SCP" when such a name arrives.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
openclaw versions <= 2026.3.12 accepted unsanitized iMessage remote attachment paths when staging files over SCP, allowing shell metacharacters in the remote path operand.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected versions:
<= 2026.3.12 - Fixed version:
2026.3.13
Details
The vulnerable path was the remote attachment staging flow in src/auto-reply/reply/stage-sandbox-media.ts. When ctx.MediaRemoteHost was set, OpenClaw staged the attachment by spawning /usr/bin/scp against <remoteHost>:<remotePath>. In affected releases, the remote host was normalized but the remote attachment path was not validated for shell metacharacters before being passed to the SCP remote operand. A sender-controlled iMessage attachment filename containing shell metacharacters could therefore trigger command execution on the configured remote host when remote attachment staging was enabled.
This issue is in scope under OpenClaw's trust model because it crosses an inbound content boundary into host command execution on a configured remote attachment host.
Fix
[email protected] validates the SCP remote path before spawning scp. Current code calls normalizeScpRemotePath(...) and rejects paths containing shell metacharacters instead of passing them through to the remote shell.
Regression coverage exists in src/auto-reply/reply.stage-sandbox-media.scp-remote-path.test.ts (rejects remote attachment filenames with shell metacharacters before spawning scp).
Fix Commit(s)
a54bf71b4c0cbe554a84340b773df37ee8e959de
Thanks @lintsinghua for reporting.
Credited to lintsinghua.
Questions
- Which OpenClaw versions are affected by GHSA-g2f6-pwvx-r275?
Versions up to and including 2026.3.12. Version 2026.3.13 is the fixed release.
- Where do the injected commands run?
On the configured remote attachment host, because scp passes the remote path to a shell there. They run as the account that OpenClaw uses for the SCP connection.
- Am I exposed if I don't use remote attachment staging?
The advisory ties the flaw to remote attachment staging, when MediaRemoteHost is set. Without that setting the SCP path is not used.
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
