CVE-2026-27487: OpenClaw: Prevent shell injection in macOS keychain credential write
On macOS, OpenClaw wrote refreshed Claude CLI OAuth credentials into Keychain through a shell command, so shell metacharacters in the token data could run commands. Only macOS installs at 2026.2.13 or earlier are affected. Upgrade to 2026.2.14.
Published Feb 18, 2026 · Updated Feb 23, 2026 · Analysis Oct 31, 2026
What an attacker can do
When the Claude CLI keychain credential refresh ran, writeClaudeCliKeychainCredentials built a security add-generic-password -w ... command as a string and ran it with execSync. The updated JSON blob, which contains OAuth tokens, was part of that string. The code escaped single quotes, but /bin/sh still interprets other constructs such as $() and backticks (CWE-78).
The tokens are user-controlled data. The pull request says they come from an OAuth provider response, so a malicious or compromised provider, or a party able to tamper with that response, could return a token that carries shell syntax. The command then runs as the logged-in macOS user during the refresh. The CVSS 3.1 vector asks for low privileges and user interaction, and rates confidentiality and integrity impact high.
For a developer, code running as their user can read SSH keys, cloud credentials, source trees and the keychain items they can unlock. Linux and Windows installs do not use this path.
Who is affected
The npm package openclaw at 2026.2.13 or earlier, on macOS only. Check the version:
npm ls -g openclaw
openclaw --versionThe vulnerable path is the Claude CLI keychain credential refresh, so installs that never use the Claude CLI credentials are less likely to reach it.
openclaw
- Ecosystem
- npm
- Affected
- < 2026.2.14
- Fixed in
- 2026.2.14
- Check
npm ls openclaw
How to fix it
Upgrade to 2026.2.14, the patched version (PR #15924, commit 9dce3d8 and two follow-ups):
npm install -g [email protected]The write now uses execFileSync("security", argv), so the payload goes to security as a literal argument and no shell parses it. Read operations still use execSync, but the PR says their interpolation is constant-only and low risk. The advisory lists no workaround.
How to tell if you were hit
The sources give no log signature. On a Mac that ran an affected version, review shell history and unified logs around OpenClaw credential refreshes for child processes you do not expect, such as curl, sh -c or osascript launched by the node process. Check Keychain Access for a changed or odd Claude CLI credential entry. If you suspect a hit, revoke and re-issue the OAuth tokens and rotate any secrets that user could read.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
On macOS, the Claude CLI keychain credential refresh path constructed a shell command to write the updated JSON blob into Keychain via security add-generic-password -w .... Because OAuth tokens are user-controlled data, this created an OS command injection risk.
The fix avoids invoking a shell by using execFileSync("security", argv) and passing the updated keychain payload as a literal argument.
Affected Packages / Versions
- Package:
openclaw(npm) - Platform: macOS only
- Affected versions:
<= 2026.2.13
Fix
- Patched version:
>= 2026.2.14(next release) - Fix PR: #15924
- Fix commits (merged to
main): 9dce3d8bf83f13c067bc3c32291643d2f1f10a0666d7178f2d6f9d60abad35797f97f3e61389b70cb908388245764fb3586859f44d1dff5372b19caf
Thanks @aether-ai-agent for reporting.
Credited to aether-ai-agent.
Questions
- Are Linux or Windows installs affected by CVE-2026-27487?
No. The advisory limits the flaw to macOS, where the keychain write path runs.
- Where do the malicious tokens come from?
The fix PR says the tokens are user-controlled and come from an OAuth provider response. The sources do not describe a specific delivery method beyond that.
- Which version fixes it?
2026.2.14, which replaces the shell call with
execFileSync("security", argv).- Is it exploited in the wild?
The sources do not report exploitation and it is not in CISA's KEV catalog.
References
Read for this analysis:
- https://github.com/openclaw/openclaw/security/advisories/GHSA-4564-pvr2-qq4h
- https://github.com/openclaw/openclaw/pull/15924
- https://github.com/openclaw/openclaw/commit/66d7178f2d6f9d60abad35797f97f3e61389b70c
- https://github.com/openclaw/openclaw/commit/9dce3d8bf83f13c067bc3c32291643d2f1f10a06
- https://github.com/openclaw/openclaw/commit/b908388245764fb3586859f44d1dff5372b19caf
- https://github.com/openclaw/openclaw/releases/tag/v2026.2.14
- https://nvd.nist.gov/vuln/detail/CVE-2026-27487
- https://github.com/advisories/GHSA-4564-pvr2-qq4h
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
