FreeBSD VuXML: Documenting security issues in FreeBSD and the FreeBSD Ports Collection

FreeBSD -- Stack buffer overflow via setcred(2)

Affected packages
15.0 <= FreeBSD-kernel < 15.0_9
14.4 <= FreeBSD-kernel < 14.4_5
14.3 <= FreeBSD-kernel < 14.3_14

Details

VuXML ID 39728e41-54b5-11f1-8d7a-bc241121aa0a
Discovery 2026-05-20
Entry 2026-05-21

Problem Description:

The setcred(2) system call is only available to privileged users. However, before the privilege level of the caller is checked, the user-supplied list of supplementary groups is copied into a fixed-size kernel stack buffer without first validating its length. If the supplied list exceeds the capacity of that buffer, a stack buffer overflow occurs.

Impact:

Because the bounds check on the supplementary groups list occurs after the kernel stack buffer has already been written, an unprivileged local user may trigger the overflow without holding any special privilege. Successful exploitation may allow an attacker to execute arbitrary code in the context of the kernel, allowing an unprivileged local user to gain elevated privileges on the affected system.

References

CVE Name CVE-2026-45250
FreeBSD Advisory SA-26:18.setcred