mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 09:53:33 +00:00
fix(security): trust resolved skill-bin paths in allowlist auto-allow
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
type ExecAsk,
|
||||
type ExecCommandSegment,
|
||||
type ExecSecurity,
|
||||
type SkillBinTrustEntry,
|
||||
} from "../infra/exec-approvals.js";
|
||||
import type { ExecHostRequest, ExecHostResponse, ExecHostRunResult } from "../infra/exec-host.js";
|
||||
import { resolveExecSafeBinRuntimePolicy } from "../infra/exec-safe-bin-runtime-policy.js";
|
||||
@@ -145,7 +146,7 @@ function evaluateSystemRunAllowlist(params: {
|
||||
trustedSafeBinDirs: ReturnType<typeof resolveExecSafeBinRuntimePolicy>["trustedSafeBinDirs"];
|
||||
cwd: string | undefined;
|
||||
env: Record<string, string> | undefined;
|
||||
skillBins: Set<string>;
|
||||
skillBins: SkillBinTrustEntry[];
|
||||
autoAllowSkills: boolean;
|
||||
}): SystemRunAllowlistAnalysis {
|
||||
if (params.shellCommand) {
|
||||
@@ -310,7 +311,7 @@ export async function handleSystemRunInvoke(opts: HandleSystemRunInvokeOptions):
|
||||
global: cfg.tools?.exec,
|
||||
local: agentExec,
|
||||
});
|
||||
const bins = autoAllowSkills ? await opts.skillBins.current() : new Set<string>();
|
||||
const bins = autoAllowSkills ? await opts.skillBins.current() : [];
|
||||
let { analysisOk, allowlistMatches, allowlistSatisfied, segments } = evaluateSystemRunAllowlist({
|
||||
shellCommand,
|
||||
argv,
|
||||
|
||||
Reference in New Issue
Block a user