As reported by SecurityAffairs, cybersecurity firm Calif has published a full proof-of-concept exploit demonstrating local privilege escalation to root on OpenBSD 7.9 by chaining two kernel flaws — one of which traces back approximately 37 years to the original BSD source tree. The exploit is notable not only for its historical pedigree but for the fact that it cleanly defeats multiple layers of OpenBSD's vaunted kernel hardening without requiring any information leak.
Vulnerability Summary
| Detail | Value |
|---|---|
| Platform | OpenBSD 7.9 (all architectures) |
| Flaw 1 | Integer overflow in shm_nattch (signed 16-bit short, inherited from BSD circa 1988) → use-after-free via race condition |
| Flaw 2 | Out-of-bounds write overwriting multicast membership counters → page table corruption enabling supervisor-level memory access |
| Bypasses | KARL kernel relinking, SMAP, SMEP |
| Errata 018 (Flaw 1) | Shipped September 14, 2026 |
| Errata 026 (Flaw 2) | Shipped September 30, 2026 |
| Patch Available | Yes — via syspatch on all architectures |
| Active Exploitation | No confirmed in-the-wild exploitation reported as of publication |
| Prerequisites | Local code execution; attacker must be able to fork processes and map shared memory segments |
Why This Matters Beyond OpenBSD
The first reaction many will have is that OpenBSD's install base is small and local privilege escalation requires initial access — so why care? Three reasons make this worth every security team's attention.
1. The 37-year-old bug is almost certainly not OpenBSD-exclusive. The shm_nattch field was defined as a signed 16-bit short in the original 4.3BSD-Reno or earlier source tree, and that definition propagated across derivatives for decades. FreeBSD, NetBSD, macOS (XNU's BSD layer), and potentially other commercial Unix descendants may carry the same or similar integer overflow patterns in their shared memory subsystems. Any OS vendor whose lineage touches historical BSD code should be auditing shm_nattch and related SysV shared memory counters immediately.
2. The exploit methodology undermines assumptions about hardware-assisted protection. SMAP and SMEP are treated as near-absolute barriers against user-space data or code being referenced in supervisor mode. The Calif exploit subverts this not by attacking the hardware features directly, but by corrupting the kernel's own accounting — the page table entries that SMAP/SMEP rely on to distinguish user pages from supervisor pages. If the page table says a user page is supervisor, SMAP will happily allow the access. This is a reminder that hardware protections are only as trustworthy as the memory metadata that feeds them.
3. KARL's deterministic allocator gap is a broader lesson. OpenBSD randomizes kernel function and data addresses at boot, which is genuinely valuable. But as the researchers point out, the kernel memory allocators themselves remain deterministic — both the boot-time allocator and the best-fit allocator lack base address randomization. Any OS that relies on boot-time relinking or KASLR without also randomizing internal allocator behavior carries a similar gap that can be leveraged once a single kernel corruption primitive is available.
Who Is at Risk
Shield53 Recommendations
Immediate Actions
- Patch now. Apply OpenBSD errata 018 and 026 via
syspatch. Reboot to ensure the patched kernel is loaded. Both patches cover all supported architectures. - Audit exposure. Identify any OpenBSD 7.9 systems that have not yet been patched, including build hosts, CI runners, and development sandboxes that are often overlooked.
- Check BSD derivatives. If you operate FreeBSD, NetBSD, or macOS infrastructure, confirm whether your vendor has issued advisories for
shm_nattchinteger overflow. File a bug if none exists yet.
Hardening and Detection
- Restrict local shell access on multi-user BSD hosts. Every user with local execution capability is a potential LPE vector — enforce least-privilege and remove interactive shells where not needed.
- Monitor for exploit indicators. The attack requires forking ~259 processes and mapping 127 shared memory segments. Alert on rapid process spawning combined with unusually high SysV shared memory segment counts from a single UID.
- Enable W^X and keep KARL active — while bypassed in this exploit, these controls still raise the cost for attackers and may break simpler exploit chains targeting the same or adjacent code.
Strategic
- Review kernel allocator randomization posture across all your Unix platforms. If your OS only randomizes load addresses but not allocator behavior, document that as a residual risk in your threat model.
- Map legacy BSD code lineage in your infrastructure. Shared memory, signal handling, and terminal subsystem code from the 1980s era is the most likely to carry inherited integer width assumptions that modern compilers and fuzzing may not flag.
The most dangerous legacy vulnerabilities are not the ones we haven't found — they're the ones sitting in code we assumed was hardened because of the reputation of the system it runs on. OpenBSD's proactive patching is commendable; the lesson is that no OS is immune to the architectural debt of its ancestors.