
























@@ -4,25 +4,25 @@ import { markOpenClawExecEnv } from "./openclaw-exec-env.js";
44const PORTABLE_ENV_VAR_KEY = /^[A-Za-z_][A-Za-z0-9_]*$/;
55const WINDOWS_COMPAT_OVERRIDE_ENV_VAR_KEY = /^[A-Za-z_][A-Za-z0-9_()]*$/;
667-export const HOST_DANGEROUS_ENV_KEY_VALUES: readonly string[] = Object.freeze([
7+const HOST_DANGEROUS_ENV_KEY_VALUES: readonly string[] = Object.freeze([
88 ...HOST_ENV_SECURITY_POLICY.blockedKeys,
99]);
10-export const HOST_DANGEROUS_ENV_PREFIXES: readonly string[] = Object.freeze([
10+const HOST_DANGEROUS_ENV_PREFIXES: readonly string[] = Object.freeze([
1111 ...HOST_ENV_SECURITY_POLICY.blockedPrefixes,
1212]);
13-export const HOST_DANGEROUS_INHERITED_ENV_KEY_VALUES: readonly string[] = Object.freeze([
13+const HOST_DANGEROUS_INHERITED_ENV_KEY_VALUES: readonly string[] = Object.freeze([
1414 ...HOST_ENV_SECURITY_POLICY.blockedInheritedKeys,
1515]);
16-export const HOST_DANGEROUS_INHERITED_ENV_PREFIXES: readonly string[] = Object.freeze([
16+const HOST_DANGEROUS_INHERITED_ENV_PREFIXES: readonly string[] = Object.freeze([
1717 ...HOST_ENV_SECURITY_POLICY.blockedInheritedPrefixes,
1818]);
19-export const HOST_DANGEROUS_OVERRIDE_ENV_KEY_VALUES: readonly string[] = Object.freeze([
19+const HOST_DANGEROUS_OVERRIDE_ENV_KEY_VALUES: readonly string[] = Object.freeze([
2020 ...HOST_ENV_SECURITY_POLICY.blockedOverrideKeys,
2121]);
22-export const HOST_DANGEROUS_OVERRIDE_ENV_PREFIXES: readonly string[] = Object.freeze([
22+const HOST_DANGEROUS_OVERRIDE_ENV_PREFIXES: readonly string[] = Object.freeze([
2323 ...HOST_ENV_SECURITY_POLICY.blockedOverridePrefixes,
2424]);
25-export const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_KEY_VALUES: readonly string[] = Object.freeze([
25+const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_KEY_VALUES: readonly string[] = Object.freeze([
2626"TERM",
2727"LANG",
2828"LC_ALL",
@@ -32,16 +32,13 @@ export const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_KEY_VALUES: readonly string
3232"NO_COLOR",
3333"FORCE_COLOR",
3434]);
35-export const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_PREFIX_VALUES: readonly string[] =
36-Object.freeze(["LC_"]);
37-export const HOST_DANGEROUS_ENV_KEYS = new Set<string>(HOST_DANGEROUS_ENV_KEY_VALUES);
38-export const HOST_DANGEROUS_INHERITED_ENV_KEYS = new Set<string>(
39-HOST_DANGEROUS_INHERITED_ENV_KEY_VALUES,
40-);
41-export const HOST_DANGEROUS_OVERRIDE_ENV_KEYS = new Set<string>(
42-HOST_DANGEROUS_OVERRIDE_ENV_KEY_VALUES,
43-);
44-export const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_KEYS = new Set<string>(
35+const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_PREFIX_VALUES: readonly string[] = Object.freeze([
36+"LC_",
37+]);
38+const HOST_DANGEROUS_ENV_KEYS = new Set<string>(HOST_DANGEROUS_ENV_KEY_VALUES);
39+const HOST_DANGEROUS_INHERITED_ENV_KEYS = new Set<string>(HOST_DANGEROUS_INHERITED_ENV_KEY_VALUES);
40+const HOST_DANGEROUS_OVERRIDE_ENV_KEYS = new Set<string>(HOST_DANGEROUS_OVERRIDE_ENV_KEY_VALUES);
41+const HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_KEYS = new Set<string>(
4542HOST_SHELL_WRAPPER_ALLOWED_OVERRIDE_ENV_KEY_VALUES,
4643);
4744@@ -59,13 +56,13 @@ function isShellWrapperAllowedOverrideEnvVarName(rawKey: string): boolean {
5956);
6057}
615862-export type HostExecEnvSanitizationResult = {
59+type HostExecEnvSanitizationResult = {
6360env: Record<string, string>;
6461rejectedOverrideBlockedKeys: string[];
6562rejectedOverrideInvalidKeys: string[];
6663};
676468-export type HostExecEnvOverrideDiagnostics = {
65+type HostExecEnvOverrideDiagnostics = {
6966rejectedOverrideBlockedKeys: string[];
7067rejectedOverrideInvalidKeys: string[];
7168};
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。