Policy bypass in Sandbox (CVE-2026-11282)
The Linux speech recognition sandbox policy used a C++ ternary operator with a BPF DSL expression, which always evaluated to true, causing the seccomp-bpf filter to unconditionally allow the mmap syscall. A compromised utility process could use restricted mmap flags to assist in a sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 days
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team.
Overview: The Linux speech recognition sandbox policy incorrectly uses a C++ ternary operator with a BPF DSL expression, which unconditionally evaluates to true at policy generation time. This causes the seccomp-bpf filter to unconditionally allow the mmap syscall, bypassing intended baseline security restrictions. A compromised utility process could potentially use these unrestricted flags to assist in a sandbox escape.
Affected files:
sandbox/policy/linux/bpf_speech_recognition_policy_linux.cc
Estimated timestamp from git blame: 2022-10-29
Description
A potential vulnerability exists in the Linux speech recognition sandbox policy (sandbox/policy/linux/bpf_speech_recognition_policy_linux.cc) where the mmap system call is unconditionally allowed due to a logic error involving the Chromium BPF Domain Specific Language (DSL).
In SpeechRecognitionProcessPolicy::EvaluateSyscall, the code attempts to conditionally allow the MAP_POPULATE flag while falling back to the baseline policy for other cases:
case __NR_mmap: {
const uint64_t kAllowedMask = MAP_POPULATE;
const bpf_dsl::Arg<int> flags(3);
return (flags & ~kAllowedMask) == 0
? Allow()
: BPFBasePolicy::EvaluateSyscall(system_call_number);
}
The issue arises from using the C++ ternary operator (? :). The BPF DSL expression (flags & ~kAllowedMask) == 0 evaluates to a bpf_dsl::BoolExpr, which is an alias for std::shared_ptr<const internal::BoolExprImpl>. To satisfy the ternary operator's condition, C++ invokes std::shared_ptr::operator bool(), which simply checks if the underlying pointer is non-null. Because the BPF AST node is always successfully allocated during policy generation, the pointer is never null.
Consequently, the condition evaluates as unconditionally true during the C++ execution phase. The policy generated for __NR_mmap becomes an unconditional Allow(), and the BPFBasePolicy::EvaluateSyscall branch is entirely omitted from the final seccomp-bpf filter.
Impact
This defense-in-depth failure bypasses the restrictions normally applied by RestrictMmapFlags() in the baseline policy. An attacker who has already compromised the speech recognition utility process can use sensitive mmap flags that are otherwise heavily restricted (such as MAP_GROWSDOWN, MAP_HUGETLB, or MAP_FIXED_NOREPLACE). Access to these flags broadens the kernel attack surface and can facilitate kernel-level sandbox escapes (e.g., via "Stack Clash" techniques).
Notably, this bug masks a secondary logic error: if bpf_dsl::If().Else() had been used correctly, the kAllowedMask logic (which only permits MAP_POPULATE) would have caused standard mmap calls (which require MAP_PRIVATE or MAP_SHARED) to fail, likely crashing the utility process on startup.
Potential Attacker Steps
Note: Our tooling does not yet have the ability to run code, so these are suggested theoretical steps an attacker would follow to trigger the vulnerability:
- Gain Remote Code Execution (RCE) within the sandboxed Speech Recognition utility process (for example, by exploiting a memory corruption bug in the closed-source audio processing library).
- Execute shellcode that calls the
mmapsyscall with sensitive flags, such asMAP_GROWSDOWN, to manipulate virtual memory area adjacency as part of a kernel exploit chain. - The kernel's seccomp-bpf engine intercepts the
mmapsyscall but unconditionally allows it due to the policy logic error, enabling the attacker to proceed with the sandbox escape.
Suggested Fix
- Replace the C++ ternary operator (
cond ? then : els) with the BPF DSL's nativeIf(cond, then).Else(els)construct. - Correct the
kAllowedMasklogic formmap. The current mask of solelyMAP_POPULATEis too restrictive and would block normal execution. Ensure the logic properly factors in the baseline allowed flags (fromRestrictMmapFlags()) alongsideMAP_POPULATEbefore enforcing the restriction.
Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The C++ ternary operator evaluated a BPF DSL expression as a boolean pointer check, which is always true, so the conditional branch was never generated.
Impact
A compromised utility process could use otherwise restricted mmap flags to broaden the kernel attack surface and potentially facilitate a sandbox escape.
What the attacker needed
Compromise of the speech recognition process
The fix
The ternary operator should be replaced with the BPF DSL's If/Else construct, and the allowed mask logic should be corrected to include baseline flags.
How it was found
- Gain remote code execution within the sandboxed speech recognition utility process.
- Execute shellcode that calls mmap with sensitive flags such as MAP_GROWSDOWN.
- The seccomp-bpf engine intercepts the syscall but unconditionally allows it, enabling the escape attempt.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A sandbox is a security boundary that limits what a program can do, even if it is compromised. Here, a mistake in the code that builds the sandbox's rules meant one system call (mmap, used to manage memory) was always allowed, instead of only being allowed with safe options. If an attacker already broke into that part of the browser, they could use dangerous memory options to try to escape the sandbox.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.