Description
In FreeBSD 15.0, the kernel structure used to represent user credentials changed: previously the primary group ID was stored in the first element of the array containing the list of supplementary group IDs, whereas now the primary group ID is stored in a dedicated field. This change was largely internal to the kernel and not user-visible.

One function, group_is_primary(), was not properly updated as a part of this transition. This function is used by mac_do to determine the primary group ID of the credential after applying a transition rule, used when the rule target does not explicitly specify a group.

As a result, with certain mac_do rules, it is possible for a credential switch to incorrectly set the primary group ID to the ID stored in the first element of the original credential's supplementary group array.

If the list of supplementary groups is empty, this value will be 0, corresponding to the "wheel" group. For example, a rule such as "uid=1001>uid=1002" can be abused to set the primary group ID to 0 even if the process did not originally belong to group 0.



Certain mac_do rules can be abused to set a process' group ID to 0. Note however, that the rule must apply to the caller in order for the bug to be triggered, e.g., given the ruleset "uid=1001>uid=1002", the user must have user ID 1001 in order to trigger the bug.

Further, logged-in users will in general have a non-empty supplementary group list, in which case the bug can at worst be used to set the credential's first supplementary group ID as its primary group ID. Processes must explicitly remove themselves from all supplementary groups, using the privileged setgroups(2) system call, in order to exploit the bug to set 0 as the primary group ID.

Since membership in group 0 is often used to enable controlled privilege escalation, the bug might be further exploitable to obtain root privileges, depending on the system configuration. For instance, a ruleset such as the following could be exploited by a process running as user 1001 and with an empty supplementary group list: "uid=1001>uid=1002;gid=0>uid=0".
Published: 2026-08-26
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises in the FreeBSD 15.0 kernel where a refactor of the credential structure caused the function group_is_primary() to misinterpret the primary group ID. During mac_do transitions that do not specify a group, the function erroneously copies the first element of the original supplementary groups array into the primary group field. This allows an attacker to cause a credential switch that assigns group ID 0 ("wheel") or another unintended group as the process’s primary group. When group 0 visibility is tied to privileged operations, this misassignment can enable privilege escalation, potentially yielding root privileges on systems that rely on group 0 for elevated access.

Affected Systems

Impact is limited to the FreeBSD operating system. The flaw exists in the 15.0 kernel, and any system that has not applied the patch that corrects group_is_primary() is affected. The advisory does not enumerate a broader version range, so the scope includes FreeBSD 15.0 installations and any downstream releases that carry the unpatched code.

Risk and Exploitability

Risk is moderate through local exploitability: an attacker must control a process that satisfies a mac_do rule such as uid=USER>uid=TARGET or gid=0>uid=0, and the attacker’s UID must match the rule’s source. If the user has an empty supplementary group list, the bug can set the primary group to 0. The EPSS score is unavailable, and the vulnerability is not listed in CISA KEV, but the potential to elevate privileges on systems that grant group‑0 members special rights motivates prompt remediation.

Generated by OpenCVE AI on August 26, 2026 at 06:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest FreeBSD patch that fixes the group_is_primary() logic; check the FreeBSD Security Advisory FreeBSD-SA-26:59.mac_do.asc for the specific update.
  • If updating is delayed, audit and remove any mac_do transition rules that allow a UID or GID to be reassigned to group 0; tighten the ruleset so that only explicit group assignments are permitted.
  • Ensure that processes do not have an empty supplementary group list when subject to mac_do transitions; otherwise, administrators should restrict user accounts from having empty supplementary lists or enforce setgroups usage to prevent the bug from enabling group 0 assignment.

Generated by OpenCVE AI on August 26, 2026 at 06:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 26 Aug 2026 06:45:00 +0000

Type Values Removed Values Added
First Time appeared Freebsd
Freebsd freebsd
Vendors & Products Freebsd
Freebsd freebsd

Wed, 26 Aug 2026 05:00:00 +0000

Type Values Removed Values Added
Description In FreeBSD 15.0, the kernel structure used to represent user credentials changed: previously the primary group ID was stored in the first element of the array containing the list of supplementary group IDs, whereas now the primary group ID is stored in a dedicated field. This change was largely internal to the kernel and not user-visible. One function, group_is_primary(), was not properly updated as a part of this transition. This function is used by mac_do to determine the primary group ID of the credential after applying a transition rule, used when the rule target does not explicitly specify a group. As a result, with certain mac_do rules, it is possible for a credential switch to incorrectly set the primary group ID to the ID stored in the first element of the original credential's supplementary group array. If the list of supplementary groups is empty, this value will be 0, corresponding to the "wheel" group. For example, a rule such as "uid=1001>uid=1002" can be abused to set the primary group ID to 0 even if the process did not originally belong to group 0. Certain mac_do rules can be abused to set a process' group ID to 0. Note however, that the rule must apply to the caller in order for the bug to be triggered, e.g., given the ruleset "uid=1001>uid=1002", the user must have user ID 1001 in order to trigger the bug. Further, logged-in users will in general have a non-empty supplementary group list, in which case the bug can at worst be used to set the credential's first supplementary group ID as its primary group ID. Processes must explicitly remove themselves from all supplementary groups, using the privileged setgroups(2) system call, in order to exploit the bug to set 0 as the primary group ID. Since membership in group 0 is often used to enable controlled privilege escalation, the bug might be further exploitable to obtain root privileges, depending on the system configuration. For instance, a ruleset such as the following could be exploited by a process running as user 1001 and with an empty supplementary group list: "uid=1001>uid=1002;gid=0>uid=0".
Title Unauthorized credential switching
Weaknesses CWE-288
References

cve-icon MITRE

Status: PUBLISHED

Assigner: freebsd

Published:

Updated: 2026-08-26T04:46:17.100Z

Reserved: 2026-06-29T01:40:17.498Z

Link: CVE-2026-58092

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-26T06:30:16Z

Weaknesses
  • CWE-288

    Authentication Bypass Using an Alternate Path or Channel