fix(core): require exact outer argv authority

This commit is contained in:
Chris Bookholt
2026-07-03 14:59:58 -07:00
parent 13a5b13880
commit 729c31bcf4
2 changed files with 6 additions and 2 deletions

View File

@@ -365,7 +365,7 @@ impl ExecPolicyManager {
matched_prefix,
decision: Decision::Allow,
..
} if matched_prefix.len() == outer.len()
} if matched_prefix.as_slice() == outer
)
})
});

View File

@@ -146,7 +146,11 @@ async fn only_exact_outer_rules_can_bypass_runtime_resolution() {
"host_executable(name = \"powershell\", paths = [\"{executable}\"])\n\
prefix_rule(pattern=[\"powershell\", {rest}], decision=\"allow\")"
),
Some(true),
Some(false),
),
(
format!("prefix_rule(pattern=[\"powershell\", {rest}], decision=\"allow\")"),
Some(false),
),
(
format!(