CVE-2026-5398 Kernel use-after-free bug in the TIOCNOTTY handler
A local attacker can exploit a use-after-free in the TIOCNOTTY handler to gain root privileges on FreeBSD systems.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-5398?
CVE-2026-5398 is a high-severity use after free vulnerability in Freebsd Freebsd, published on 22 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
The implementation of TIOCNOTTY failed to clear a back-pointer from the structure representing the controlling terminal to the calling process' session. If the invoking process then exits, the terminal structure may end up containing a pointer to freed memory.
A malicious process can abuse the dangling pointer to grant itself root privileges.
Weakness: CWE-416
Which versions are affected by CVE-2026-5398?
It affects 1 product.
Products include Freebsd Freebsd.
How do I fix CVE-2026-5398?
No fix has been published for CVE-2026-5398 yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2026-5398 being exploited?
There is no known exploitation of CVE-2026-5398 in the wild and no public exploit code.
Other vulnerabilities in Freebsd Freebsd
Sources
Also known as GHSA-w9v4-7vpf-w2r4.