-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
=============================================================================
FreeBSD-SA-26:22.libcasper Security Advisory
The FreeBSD Project
Topic: select(2) file descriptor set overflow causes stack overflow
Category: core
Module: libcasper
Announced: 2026-05-20
Credits: Joshua Rogers of AISLE Research Team
Affects: All supported versions of FreeBSD.
Corrected: 2026-05-20 19:36:41 UTC (stable/15, 15.0-STABLE)
2026-05-20 19:39:35 UTC (releng/15.0, 15.0-RELEASE-p9)
2026-05-20 19:38:00 UTC (stable/14, 14.4-STABLE)
2026-05-20 19:40:00 UTC (releng/14.4, 14.4-RELEASE-p5)
2026-05-20 19:40:38 UTC (releng/14.3, 14.3-RELEASE-p14)
CVE Name: CVE-2026-39461
For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit .
I. Background
libcasper(3) allows Capsicum-sandboxed applications to access system
interfaces that are otherwise unavailable within the sandbox. It is
used by numerous programs in the base system.
II. Problem Description
libcasper(3) communicates with helper processes via UNIX domain sockets, and
uses the select(2) system call to wait for data to become available.
However, it does not verify that its socket descriptor fits within
select(2)'s descriptor set size limit of FD_SETSIZE (1024).
III. Impact
An attacker able to cause an application using libcasper(3) to allocate large
file descriptors, e.g., by opening many descriptors and executing a program
which is not careful to close them upon startup, may trigger stack
corruption. If the target application runs with setuid root privileges, this
could be used to escalate local privileges.
IV. Workaround
No workaround is available.
V. Solution
Upgrade your vulnerable system to a supported FreeBSD stable or
release / security branch (releng) dated after the correction date.
Perform one of the following:
1) To update your vulnerable system installed from base system packages:
Systems running a 15.0-RELEASE version of FreeBSD on the amd64 or arm64
platforms, which were installed using base system packages, can be updated
via the pkg(8) utility:
# pkg upgrade -r FreeBSD-base
# shutdown -r +10min "Rebooting for a security update"
2) To update your vulnerable system installed from binary distribution sets:
Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms,
or the i386 platform on FreeBSD 13, which were not installed using base
system packages, can be updated via the freebsd-update(8) utility:
# freebsd-update fetch
# freebsd-update install
# shutdown -r +10min "Rebooting for a security update"
3) To update your vulnerable system via a source code patch:
The following patches have been verified to apply to the applicable
FreeBSD release branches.
a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.
[FreeBSD 15.x]
# fetch https://security.FreeBSD.org/patches/SA-26:22/libcasper-15.patch
# fetch https://security.FreeBSD.org/patches/SA-26:22/libcasper-15.patch.asc
# gpg --verify libcasper-15.patch.asc
[FreeBSD 14.x]
# fetch https://security.FreeBSD.org/patches/SA-26:22/libcasper-14.patch
# fetch https://security.FreeBSD.org/patches/SA-26:22/libcasper-14.patch.asc
# gpg --verify libcasper-14.patch.asc
b) Apply the patch. Execute the following commands as root:
# cd /usr/src
# patch < /path/to/patch
c) Recompile the operating system using buildworld and installworld as
described in .
Restart the applicable daemons, or reboot the system.
VI. Correction details
This issue is corrected as of the corresponding Git commit hash in the
following stable and release branches:
Branch/path Hash Revision
- -------------------------------------------------------------------------
stable/15/ 23929d729d1a stable/15-n283644
releng/15.0/ e22f3f55c360 releng/15.0-n281044
stable/14/ 9e74d5e2e5e4 stable/14-n274167
releng/14.4/ ae34dd1a391f releng/14.4-n273707
releng/14.3/ cbec31838173 releng/14.3-n271507
- -------------------------------------------------------------------------
Run the following command to see which files were modified by a
particular commit:
# git show --stat
Or visit the following URL, replacing NNNNNN with the hash:
To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:
# git rev-list --count --first-parent HEAD
VII. References
The latest revision of this advisory is available at
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCgA5FiEEthUnfoEIffdcgYM7bljekB8AGu8FAmoOKHsbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEG5Y3pAfABrveQAP/iyv1O1XI6tSrRictadU
9tBJFE5WlWGPrB8ID/12nLsKaTM5hzbA1G+v8c3So3FaSEl+m7D8BTri4X0XPibQ
5Pp4v67MO+yqsNxOjwyqAizOnD5bk/sEUuBV5JijZuqsAiEWFw5l0dKDU83zt3vu
hyk8/eeKuIxEwDiWQoeE32RM3BupY1ClWp46kiSjvOVzUK04miHQjgFFnVqkBuI7
DeanTjzCw3g+RQNTRKVGE2LYRLFHka6m4Z5RYT7beFOLdlD58T7lvQLl3l3f2QSR
hXcq5RxAhf4omPkm432fIdd4nev4gti3rxJC76NM2rIHGeSlRd4O7MHreNwNkU2O
8Rv8IWMCM20zZCtbov7q8XbTqKp8JXSJ/8g15iZuZ4wk+THnpRy7dsRe5eYQvVbB
J/zBKB9xMXGp69+88uZHDsSSoS841pkZ61+MlxeK4xC3MO6tlTO0Hannhmy8WCb4
U5GimvX3EcvhGeBWRvPTdPJY9EcrDPDU2djaiFzPZZ7rrUjR8YJ685fyj161nnb+
ibubcwiz7ygQu8b9T0rc1AV5ZTAC/QAlRarDpRNx2Ynh/FlZ89n+N5LnSHwGXc/v
/P+ob/5AqdLfyofw5pcx/FVuAiK4bjqDGGYuZw1tplg/L7AV3k87zIMYdCgr3e95
PyQCsFAG014gMVETPGHKm6/7
=ypPx
-----END PGP SIGNATURE-----