Enforce CDP source-range restriction by default
fix(sandbox): enforce CDP source-range restriction by default (#61404)
Enforce CDP source-range restriction by defaultfbf11e-fix-enforce-cdp-source-range-restriction-by-default-cve-2026-43581fixenforce cdp source range restriction default
Committed by dims
commit message
fix(sandbox): enforce CDP source-range restriction by default (#61404)
* fix(sandbox): enforce CDP source-range restriction by default
Auto-derive CDP_SOURCE_RANGE from Docker network gateway IP when not
explicitly configured. The entrypoint script refuses to start the socat
CDP relay without a source range (fail-closed).
- readDockerNetworkGateway: use Go template println, filter <no value>
sentinel, prefer IPv4 gateway on dual-stack networks
- Reject IPv6-only gateways for auto-derivation (relay binds IPv4)
- Remove stale browser_cdp_bridge_unrestricted audit check (runtime
auto-derives range for all bridge-like networks)
- Bump SANDBOX_BROWSER_SECURITY_HASH_EPOCH to force container recreation
* chore(changelog): add sandbox CDP source-range entry
* fix(sandbox): gate CDP source-range derivation to bridge-style networks
Only auto-derive OPENCLAW_BROWSER_CDP_SOURCE_RANGE from the Docker
gateway IP for bridge networks (or when driver is unknown). Non-bridge
drivers (macvlan, ipvlan, overlay) may route traffic from different
source IPs, so they require explicit cdpSourceRange config.
Adds readDockerNetworkDriver helper and a regression test for macvlan.
---------
Co-authored-by: Devin Robison <[email protected]>Editor assessment
This commit patches CVE-2026-43581. The subject `fix(sandbox): enforce CDP source-range restriction by default (#61404)` is clear about the new default, and the body is the strongest in this set: it explains deriving CDP_SOURCE_RANGE from the Docker gateway IP, the entrypoint's fail-closed refusal, the preference for IPv4 on dual-stack networks, removal of the stale audit check, and the epoch bump that forces container recreation. The second part even explains the bridge-only limitation by contrasting macvlan, ipvlan, and overlay source addressing and names a regression test for macvlan. Minor merge residue such as the divider and co-author trailer does not undermine the rationale. Exemplary teaching material.