CVE-2026-49419 in FreeBSDinfo

Summary

by MITRE • 08/19/2026

When the JAIL_AT_DESC flag is specified, kern_jail_set() and kern_jail_get() released the reference to the caller's current prison before looking up the jail descriptor. If the descriptor lookup failed, error-handling paths released the same reference a second time.

An unprivileged local user can trigger a prison reference count underflow, which may cause the prison structure to be freed while still in use. When this is done on the jail host, the bug will generally result in an immediate panic. However, if the user is running in a jail, then it may be possible to exploit the bug to elevate privileges.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 08/20/2026

The vulnerability described involves a critical reference counting error within the FreeBSD kernel's prison management subsystem, specifically affecting the kern_jail_set and kern_jail_get functions when invoked with the JAIL_AT_DESC flag. This flaw stems from an improper handling of resource lifecycles during descriptor lookup operations. Under normal operation, these system calls are responsible for managing references to jail structures, which represent isolated execution environments within the operating system. The core technical defect occurs because the kernel releases a reference to the caller's current prison before attempting to look up the specified jail descriptor using JAIL_AT_DESC. This premature release creates a window of vulnerability where the integrity of the reference count is compromised if subsequent operations fail or behave unexpectedly.

The severity of this issue is amplified by the error-handling logic within these functions. If the lookup for the target jail descriptor fails, the code paths intended to clean up and return an error state proceed to release the same prison reference a second time. Since the initial reference was already released prior to the lookup attempt, this secondary release results in a double-free scenario relative to that specific reference count. Consequently, an unprivileged local user can trigger a prison reference count underflow by repeatedly invoking these system calls with invalid or non-existent descriptors while ensuring the JAIL_AT_DESC flag is set. This manipulation drives the internal counter below zero, leading to memory corruption and potential use-after-free conditions as the kernel attempts to manage structures that it believes have been fully dereferenced but are still active in memory.

The operational impact of this vulnerability varies significantly depending on the execution context of the attacker. When exploited from within a standard jail environment, the immediate consequence is typically a system panic or crash due to the corruption of critical kernel data structures associated with prison management. This results in a denial-of-service condition for all users and services hosted on that machine. However, if an unprivileged user operates directly on the host system without being confined to a jail, they may be able to exploit this memory corruption more effectively. By carefully controlling the state of the kernel heap and timing the exploitation correctly, it is possible to manipulate pointers or function addresses within the freed prison structure. This can lead to arbitrary code execution with root privileges, allowing an attacker to completely compromise the integrity, confidentiality, and availability of the host system.

From a classification perspective, this vulnerability aligns closely with CWE-362, which describes concurrent execution race conditions leading to resource use after free or double-free scenarios, although in this specific case, it is more accurately characterized as a logic error resulting in reference count underflow rather than a traditional time-of-check-to-time-of-use race condition. The exploitation technique involves manipulating kernel memory state to achieve privilege escalation, which maps to the MITRE ATT&CK tactic of Privilege Escalation and specifically techniques related to exploiting improper access control or resource management flaws within the operating system kernel. Such vulnerabilities are particularly dangerous because they bypass user-space security boundaries and directly compromise the trust anchor of the virtualization layer provided by jails.

Mitigation strategies for this vulnerability primarily involve applying vendor-supplied patches that correct the reference counting logic in kern_jail_set and kern_jail_get. The fix typically requires ensuring that references to prison structures are only released after all necessary lookups and validations have completed successfully, or implementing a copy-on-write mechanism where appropriate to avoid premature dereferencing. Until such patches are applied, system administrators should restrict access to jail management functions by limiting the privileges of users who can invoke these specific syscalls. Additionally, enabling kernel debugging features in non-production environments may help detect anomalous reference count behaviors through panic logs or trace data, although this does not prevent exploitation. Regular auditing of user permissions and minimizing the number of accounts with capabilities to manage jails are essential defensive measures against potential abuse of this flaw.

Responsible

Freebsd

Reservation

05/29/2026

Disclosure

08/19/2026

Moderation

accepted

CPE

ready

EPSS

0.00157

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!