diff --git a/apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift b/apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift index a9f1ec63432f..4ef385d708c4 100644 --- a/apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift +++ b/apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift @@ -59,6 +59,7 @@ enum HostEnvSecurityPolicy { "CORECLR_PROFILER_PATH", "CPATH", "CPLUS_INCLUDE_PATH", + "CPP", "CURL_HOME", "CXX", "C_INCLUDE_PATH", @@ -241,6 +242,7 @@ enum HostEnvSecurityPolicy { "CONFIG_SHELL", "CONFIG_SITE", "CORECLR_PROFILER", + "CPP", "CXX", "DOTNET_ADDITIONAL_DEPS", "DOTNET_STARTUP_HOOKS", diff --git a/src/infra/host-env-security-policy.json b/src/infra/host-env-security-policy.json index 663fc03e1c74..094a47ab6333 100644 --- a/src/infra/host-env-security-policy.json +++ b/src/infra/host-env-security-policy.json @@ -35,6 +35,7 @@ "GIT_SSL_CAINFO", "GIT_SSL_CAPATH", "CC", + "CPP", "CXX", "CARGO_BUILD_RUSTC", "CARGO_BUILD_RUSTC_WRAPPER", diff --git a/src/infra/host-env-security.reported-baseline.json b/src/infra/host-env-security.reported-baseline.json index 62064867cbf4..f92d7a43f603 100644 --- a/src/infra/host-env-security.reported-baseline.json +++ b/src/infra/host-env-security.reported-baseline.json @@ -21,6 +21,7 @@ "CONFIG_SHELL", "CONFIG_SITE", "CORECLR_PROFILER", + "CPP", "CXX", "DOTNET_ADDITIONAL_DEPS", "DOTNET_STARTUP_HOOKS", @@ -269,5 +270,5 @@ "YARN_RC_FILENAME", "ZDOTDIR" ], - "expectedTotalReportedEntries": 264 + "expectedTotalReportedEntries": 265 } diff --git a/src/infra/host-env-security.reported-baseline.test.ts b/src/infra/host-env-security.reported-baseline.test.ts index 12cfd5138a84..c66fe0f75111 100644 --- a/src/infra/host-env-security.reported-baseline.test.ts +++ b/src/infra/host-env-security.reported-baseline.test.ts @@ -98,7 +98,7 @@ describe("host env reported baseline coverage", () => { baseline.reportedDangerousEverywhereKeys.length + baseline.reportedDangerousOverrideOnlyKeys.length, ).toBe(baseline.expectedTotalReportedEntries); - expect(baseline.expectedTotalReportedEntries).toBe(264); + expect(baseline.expectedTotalReportedEntries).toBe(265); expect(sortUniqueUpper(baseline.reportedDangerousEverywhereKeys)).toEqual( baseline.reportedDangerousEverywhereKeys, ); diff --git a/src/infra/host-env-security.test.ts b/src/infra/host-env-security.test.ts index ff5e550a095f..5c5cc96287e8 100644 --- a/src/infra/host-env-security.test.ts +++ b/src/infra/host-env-security.test.ts @@ -180,6 +180,7 @@ describe("isDangerousHostEnvVarName", () => { expect(isDangerousHostEnvVarName("aws_web_identity_token_file")).toBe(false); expect(isDangerousHostEnvVarName("AZURE_AUTH_LOCATION")).toBe(false); expect(isDangerousHostEnvVarName("CC")).toBe(true); + expect(isDangerousHostEnvVarName("cpp")).toBe(true); expect(isDangerousHostEnvVarName("cxx")).toBe(true); expect(isDangerousHostEnvVarName("CARGO_BUILD_RUSTC")).toBe(true); expect(isDangerousHostEnvVarName("cargo_build_rustc")).toBe(true); @@ -384,6 +385,7 @@ describe("sanitizeHostExecEnv", () => { AZURE_AUTH_LOCATION: "/tmp/azure-auth.json", AWS_CONFIG_FILE: "/tmp/aws-config", SSH_AUTH_SOCK: "/tmp/trusted-ssh-agent.sock", + CPP: "/tmp/evil-cpp", CARGO_HOME: "/tmp/cargo", RUSTUP_DIST_ROOT: "https://mirror.example.test/deprecated-dist", RUSTUP_DIST_SERVER: "https://mirror.example.test", @@ -519,6 +521,7 @@ describe("sanitizeHostExecEnv", () => { ["BASH_ENV", "/tmp/pwn.sh"], ["BROWSER", "/tmp/browser"], ["CC", "/tmp/evil-cc"], + ["CPP", "/tmp/evil-cpp"], ["CXX", "/tmp/evil-cxx"], ["CARGO_BUILD_RUSTC", "/tmp/evil-rustc"], ["CARGO_BUILD_RUSTC_WRAPPER", "/tmp/evil-rustc-wrapper"], @@ -1179,6 +1182,7 @@ describe("sanitizeHostExecEnvWithDiagnostics", () => { it("reports blocked and invalid requested overrides", () => { const overrides = envRecord([ ["PATH", "/tmp/evil"], + ["CPP", "/tmp/evil-cpp"], ["CXX", "/tmp/evil-cxx"], ["CARGO_BUILD_RUSTC_WRAPPER", "/tmp/evil-rustc-wrapper"], ["CARGO_REGISTRIES_CRATES_IO_INDEX", "https://example.invalid/crates.io-index"], @@ -1280,6 +1284,7 @@ describe("sanitizeHostExecEnvWithDiagnostics", () => { "CONDA_PREFIX", "CPATH", "CPLUS_INCLUDE_PATH", + "CPP", "CURL_CA_BUNDLE", "CXX", "C_INCLUDE_PATH",