fix(sandbox): harden seccomp denylist, SSRF protection, and inference policy enforcement#819
Merged
johntmyers merged 4 commits intomainfrom Apr 13, 2026
Merged
Conversation
5d2f13d to
3fcf9ff
Compare
… policy enforcement - Remove seccomp skip in NetworkMode::Allow so baseline syscall restrictions apply regardless of network mode - Block cross-process manipulation syscalls (process_vm_writev, pidfd_open, pidfd_getfd, pidfd_send_signal) symmetric with existing ptrace and process_vm_readv blocks - Block clone/clone3 with CLONE_NEWUSER flag, new mount API syscalls (fsopen, fsconfig, fsmount, fspick, move_mount, open_tree), and namespace manipulation (setns, umount2, pivot_root) - Block userfaultfd and perf_event_open consistent with Docker default seccomp profile - Deny and close keep-alive inference connections after a non-inference request instead of silently continuing the loop - Add CGNAT (100.64.0.0/10), benchmarking (198.18.0.0/15), and other special-use IP ranges to SSRF protection in both proxy and mechanistic mapper
3fcf9ff to
84834ab
Compare
pimlock
approved these changes
Apr 13, 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
Addresses the top 4 immediate-priority findings from the NemoClaw-OpenShell TAVA security architecture review (Table 8.7 FSRs). All changes are in
openshell-sandbox— three files, surgical fixes with full test coverage.Closes OS-56, closes OS-63, closes OS-58, closes OS-59, closes OS-61, closes OS-68
Changes
Seccomp hardening (
seccomp.rs)apply()function previously returned early forNetworkMode::Allow, skipping all syscall filtering. Now unconditional blocks and conditional arg-based blocks always apply; only socket domain blocks remain conditional on network mode.process_vm_writev,pidfd_open,pidfd_getfd,pidfd_send_signalto the unconditional denylist, symmetric with existingptraceandprocess_vm_readvblocks.clone/clone3withCLONE_NEWUSERflag (masked arg rules), new mount API syscalls (fsopen,fsconfig,fsmount,fspick,move_mount,open_tree), and namespace manipulation (setns,umount2,pivot_root).userfaultfdandperf_event_open, consistent with Docker's default seccomp profile.build_filterintobuild_filter_rules+ compilation step so tests can inspect the rules map directly.Inference policy enforcement (
proxy.rs)else if !routed_anyto unconditionalelseso a non-inference request on a keep-alive connection that previously routed inference traffic is denied and closed, rather than silently ignored.SSRF protection (
proxy.rs,mechanistic_mapper.rs)is_internal_ipnow block CGNAT100.64.0.0/10(RFC 6598), IETF protocol assignments192.0.0.0/24(RFC 6890), benchmarking198.18.0.0/15(RFC 2544), TEST-NET-2198.51.100.0/24, and TEST-NET-3203.0.113.0/24. Extracted sharedis_internal_v4helper to reduce duplication within each file.Testing
unconditional_blocks_present_in_filter— verifies all 21 unconditional syscall blocksconditional_blocks_have_rules— verifies clone, clone3, unshare, execveat, seccomp conditional rulestest_rejects_ipv4_cgnat— CGNAT boundary tests (both accept and reject)test_rejects_ipv4_special_use_ranges— all new special-use rangestest_rejects_ipv6_mapped_cgnat— IPv4-mapped IPv6 CGNAT addressestest_is_internal_ip_cgnat/test_is_internal_ip_special_use— mechanistic mapper equivalents