fix(sandbox): harden seccomp filter to block dangerous syscalls#740
Merged
johntmyers merged 1 commit intomainfrom Apr 2, 2026
Merged
fix(sandbox): harden seccomp filter to block dangerous syscalls#740johntmyers merged 1 commit intomainfrom
johntmyers merged 1 commit intomainfrom
Conversation
drew
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the seccomp-BPF filter in the sandbox runtime to block syscalls that enable sandbox escape. The existing filter only restricted socket domains; this change adds unconditional and conditional blocks for 9 additional dangerous syscalls.
Changes
crates/openshell-sandbox/src/sandbox/linux/seccomp.rs:memfd_create,ptrace,bpf,process_vm_readv,io_uring_setup, andmount-- these syscalls have no legitimate use in the sandbox agent runtimeexecveat(whenAT_EMPTY_PATHflag is set),unshare(whenCLONE_NEWUSERflag is set), andseccomp(when operation isSECCOMP_SET_MODE_FILTER) -- blocks dangerous flag combinations while preserving normal useadd_masked_arg_rulehelper forMaskedEqcondition constructionarchitecture/sandbox.md: Updated seccomp section with socket, unconditional, and conditional block tablesarchitecture/security-policy.md: Added blocked syscalls and conditionally blocked syscalls tables with NR referencesMotivation
The seccomp filter used a default-allow policy that only restricted specific socket domains. This left the sandbox vulnerable to:
memfd_create+execveat(AT_EMPTY_PATH)creates and executes binaries entirely in memory, bypassing Landlock's path-based filesystem controlsptraceandprocess_vm_readvallow inspecting/injecting memory in other sandbox processesbpfandio_uring_setupexpose kernel subsystems with extensive CVE historyunshare(CLONE_NEWUSER)enables user namespace creation for UID remappingThese syscalls are all blocked by Docker's default seccomp profile. This change brings the sandbox in line with that baseline for these specific syscalls.
Testing
Checklist