mirror of
https://github.com/openai/codex.git
synced 2026-11-29 15:36:12 +00:00
Bind unified exec approvals to shell executables (#39311)
## Why An unfamiliar executable can ignore its arguments, so trust in an apparent inner command must not implicitly trust the executable that runs it. ## What changed - Evaluate unfamiliar shell executables alongside their parsed commands when determining unified exec approval requirements. Inner commands can add restrictions, but cannot grant trust to the executable. - Include the executable in reusable approval keys so approval for one custom shell does not apply to another. - Parse literal PowerShell scripts without launching the requested executable, preserving command policy checks before approval. ## Testing Add cross-platform coverage for spoofed shell paths, allowed and forbidden inner commands, explicit custom-shell approval, and session approval isolation. GitOrigin-RevId: 0dd2c7e9a2ac30965ef5fe5de1a8d2968bb5f9d0
This commit is contained in:
1 parent
280d56b1d8
commit
7d9990fa30
11 files changed
+606
-21
No files matched your search
@@ -237,6 +237,7 @@ impl ApprovalAction {
|
||||
..
|
||||
} => vec![ApprovalCacheKey::ExecCommand(UnifiedExecApprovalKey {
|
||||
environment_id: environment_id.clone(),
|
||||
executable: command.first().cloned(),
|
||||
command: canonicalize_command_for_approval(command),
|
||||
cwd: cwd.clone(),
|
||||
tty: *tty,
|
||||
|
||||
@@ -88,6 +88,7 @@ pub struct UnifiedExecRequest {
|
||||
#[derive(serde::Serialize, Clone, Debug, Eq, PartialEq, Hash)]
|
||||
pub struct UnifiedExecApprovalKey {
|
||||
pub environment_id: String,
|
||||
pub executable: Option<String>,
|
||||
pub command: Vec<String>,
|
||||
pub cwd: PathUri,
|
||||
pub tty: bool,
|
||||
|
||||
Reference in new issue
Block a user