CVE-2026-41372 Overview
OpenClaw before version 2026.4.2 contains a loopback protection bypass vulnerability in its remote CDP (Chrome DevTools Protocol) discovery response handling. The application fails to normalize trailing-dot localhost hosts (e.g., localhost.) in discovery responses, allowing attackers to bypass loopback protections. By crafting hostile discovery responses that return localhost. instead of localhost, attackers can retarget authenticated browser control toward localhost endpoints and potentially expose sensitive browser state.
Critical Impact
Attackers can bypass loopback protections to redirect authenticated browser control to localhost endpoints, exposing browser state and potentially enabling further exploitation of local services.
Affected Products
- OpenClaw versions prior to 2026.4.2
- OpenClaw for Node.js (all affected versions)
- Applications using OpenClaw's CDP discovery functionality
Discovery Timeline
- 2026-04-28 - CVE-2026-41372 published to NVD
- 2026-04-28 - Last updated in NVD database
Technical Details for CVE-2026-41372
Vulnerability Analysis
This vulnerability is classified under CWE-639 (Authorization Bypass Through User-Controlled Key). The core issue lies in how OpenClaw handles hostname normalization when processing CDP discovery responses. DNS standards allow hostnames to have trailing dots (FQDN format), where localhost. is technically equivalent to localhost. However, OpenClaw's loopback protection logic performed a strict string comparison without first normalizing the hostname, creating a security bypass opportunity.
The vulnerability is network-exploitable without requiring authentication or user interaction. An attacker positioned to intercept or inject CDP discovery responses can leverage this flaw to redirect browser control operations to localhost endpoints, potentially exposing sensitive browser state including session cookies, local storage, and other security-sensitive data.
Root Cause
The root cause is improper input validation in the hostname normalization logic within src/gateway/net.ts. The original code compared the normalized host directly against the string "localhost" without first removing trailing dots. This meant that a hostname like localhost. would fail the localhost check and be treated as a non-local host, bypassing loopback protections designed to prevent external access to local browser endpoints.
Attack Vector
An attacker can exploit this vulnerability by:
- Positioning themselves to respond to or intercept CDP discovery requests (e.g., via network-level attack or compromised discovery service)
- Crafting a malicious discovery response that returns localhost. (with trailing dot) as the target host
- The victim's OpenClaw instance accepts this as a valid non-localhost host, bypassing loopback protections
- Authenticated browser control is redirected to the localhost endpoint
- The attacker can then access exposed browser state through the bypassed protection
The following patch shows the security fix that was applied:
return null;
}
const normalizedHost = host.trim().toLowerCase();
- if (normalizedHost === "localhost") {
- return { isLocalhost: true, unbracketedHost: normalizedHost };
+ const canonicalHost = normalizedHost.replace(/\.+$/, "");
+ if (canonicalHost === "localhost") {
+ return { isLocalhost: true, unbracketedHost: canonicalHost };
}
return {
isLocalhost: false,
Source: GitHub Commit Details
The fix introduces a canonicalization step that removes trailing dots from the hostname before performing the localhost comparison, ensuring that both localhost and localhost. are correctly identified as loopback addresses.
Detection Methods for CVE-2026-41372
Indicators of Compromise
- CDP discovery responses containing hostnames with trailing dots (e.g., localhost., 127.0.0.1.)
- Unexpected connections to localhost endpoints from external discovery sources
- Network traffic patterns showing CDP protocol communication with anomalous host formats
- Log entries indicating browser control redirection to localhost from external sources
Detection Strategies
- Monitor CDP discovery traffic for hostnames containing trailing dots that may indicate bypass attempts
- Implement network-level detection rules to flag discovery responses with malformed or suspicious hostname formats
- Review application logs for instances where loopback protections may have been bypassed
- Audit OpenClaw version deployments to identify instances running vulnerable versions prior to 2026.4.2
Monitoring Recommendations
- Enable verbose logging for CDP discovery operations to capture hostname resolution details
- Deploy network monitoring to detect anomalous patterns in browser automation traffic
- Implement alerting for any localhost-bound traffic originating from external discovery responses
- Regularly audit Node.js package dependencies to ensure OpenClaw is updated to patched versions
How to Mitigate CVE-2026-41372
Immediate Actions Required
- Update OpenClaw to version 2026.4.2 or later immediately
- Review recent CDP discovery logs for evidence of exploitation attempts
- Implement network segmentation to limit exposure of CDP discovery endpoints
- Audit systems for any signs of unauthorized browser state access
Patch Information
The vulnerability has been addressed in OpenClaw version 2026.4.2. The security fix is available in commit 9c22d636697336a6b22b0ae24798d8b8325d7828. Organizations should update immediately by running their package manager update commands. Additional details are available in the GitHub Security Advisory and the VulnCheck Advisory.
Workarounds
- Restrict network access to CDP discovery endpoints to trusted networks only
- Implement application-level firewall rules to block CDP discovery responses from untrusted sources
- Deploy a reverse proxy that normalizes hostnames before they reach OpenClaw
- Consider disabling remote CDP discovery if not required for your use case
# Update OpenClaw to patched version
npm update openclaw@2026.4.2
# Verify installed version
npm list openclaw
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

