Skip to content

Commit f84a41d

Browse files
authored
fix(security): block JVM, Python, and .NET env injection vectors in host exec sandbox (#49025)
Add JAVA_TOOL_OPTIONS, _JAVA_OPTIONS, JDK_JAVA_OPTIONS, PYTHONBREAKPOINT, and DOTNET_STARTUP_HOOKS to blockedKeys in the host exec security policy. Closes #22681
1 parent 1399ca5 commit f84a41d

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ Docs: https://docs.openclaw.ai
442442
- Memory/QMD Windows: fail closed when `qmd.cmd` or `mcporter.cmd` wrappers cannot be resolved to a direct entrypoint, so memory search no longer falls back to shell execution on Windows.
443443
- macOS/remote gateway: stop PortGuardian from killing Docker Desktop and other external listeners on the gateway port in remote mode, so containerized and tunneled gateway setups no longer lose their port-forward owner on app startup. (#6755) Thanks @teslamint.
444444
- Feishu/streaming recovery: clear stale `streamingStartPromise` when card creation fails (HTTP 400) so subsequent messages can retry streaming instead of silently dropping all future replies. Fixes #43322.
445+
- Exec/env sandbox: block JVM agent injection (`JAVA_TOOL_OPTIONS`, `_JAVA_OPTIONS`, `JDK_JAVA_OPTIONS`), Python breakpoint hijack (`PYTHONBREAKPOINT`), and .NET startup hooks (`DOTNET_STARTUP_HOOKS`) from the host exec environment. (#49025)
445446

446447
## 2026.3.8
447448

apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ enum HostEnvSecurityPolicy {
2323
"PS4",
2424
"GCONV_PATH",
2525
"IFS",
26-
"SSLKEYLOGFILE"
26+
"SSLKEYLOGFILE",
27+
"JAVA_TOOL_OPTIONS",
28+
"_JAVA_OPTIONS",
29+
"JDK_JAVA_OPTIONS",
30+
"PYTHONBREAKPOINT",
31+
"DOTNET_STARTUP_HOOKS"
2732
]
2833

2934
static let blockedOverrideKeys: Set<String> = [

src/infra/host-env-security-policy.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
"PS4",
1818
"GCONV_PATH",
1919
"IFS",
20-
"SSLKEYLOGFILE"
20+
"SSLKEYLOGFILE",
21+
"JAVA_TOOL_OPTIONS",
22+
"_JAVA_OPTIONS",
23+
"JDK_JAVA_OPTIONS",
24+
"PYTHONBREAKPOINT",
25+
"DOTNET_STARTUP_HOOKS"
2126
],
2227
"blockedOverrideKeys": [
2328
"HOME",

src/infra/host-env-security.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ describe("isDangerousHostEnvVarName", () => {
4848
expect(isDangerousHostEnvVarName("DYLD_INSERT_LIBRARIES")).toBe(true);
4949
expect(isDangerousHostEnvVarName("ld_preload")).toBe(true);
5050
expect(isDangerousHostEnvVarName("BASH_FUNC_echo%%")).toBe(true);
51+
expect(isDangerousHostEnvVarName("JAVA_TOOL_OPTIONS")).toBe(true);
52+
expect(isDangerousHostEnvVarName("java_tool_options")).toBe(true);
53+
expect(isDangerousHostEnvVarName("_JAVA_OPTIONS")).toBe(true);
54+
expect(isDangerousHostEnvVarName("_java_options")).toBe(true);
55+
expect(isDangerousHostEnvVarName("JDK_JAVA_OPTIONS")).toBe(true);
56+
expect(isDangerousHostEnvVarName("jdk_java_options")).toBe(true);
57+
expect(isDangerousHostEnvVarName("PYTHONBREAKPOINT")).toBe(true);
58+
expect(isDangerousHostEnvVarName("pythonbreakpoint")).toBe(true);
59+
expect(isDangerousHostEnvVarName("DOTNET_STARTUP_HOOKS")).toBe(true);
60+
expect(isDangerousHostEnvVarName("dotnet_startup_hooks")).toBe(true);
5161
expect(isDangerousHostEnvVarName("PATH")).toBe(false);
5262
expect(isDangerousHostEnvVarName("FOO")).toBe(false);
5363
});

0 commit comments

Comments
 (0)