The vulnerability, GHSA-525j-hqq2-66r4, stems from the OpenClaw sandbox browser's Chrome DevTools Protocol (CDP) relay binding to 0.0.0.0 without IP restrictions, exposing it to other containers on the same Docker network. The root cause within the application code is the ensureSandboxBrowser function in src/agents/sandbox/browser.ts. This function orchestrates the creation of the sandbox container.
Prior to the fix, ensureSandboxBrowser would only pass the CDP_SOURCE_RANGE environment variable to the container if it was explicitly defined in the user's configuration. If undefined, the container's entrypoint script (scripts/sandbox-browser-entrypoint.sh) would default to starting a socat process that listened on 0.0.0.0 without any range restriction, creating the vulnerability.
The patch addresses this by modifying ensureSandboxBrowser to be fail-safe. It now ensures that CDP_SOURCE_RANGE is always set. If not explicitly configured, the function attempts to derive it from the Docker network's gateway IP for bridge-like networks. If a source range cannot be determined, the function throws an error, preventing the container from starting in an insecure configuration. This change ensures that the CDP relay is always restricted, mitigating the risk of unauthorized access.