CVE-2026-58098

Heap out-of-bounds access in semop(2)

Published Oct 15, 2026 CVSS 3.1 · 8.4 High EPSS < 1% KEV · Not listed
Description
When semop(2) blocks waiting for a semaphore condition, it releases the per-set lock and sleeps. Upon waking, it checks the sequence number embedded in the semaphore set's IPC identifier to detect whether the set was removed while the caller was asleep. This sequence number is only 15 bits wide. If enough semaphore sets are created and destroyed in the same table slot while a caller is blocked, the counter wraps around, and semop(2) may falsely conclude that the original set still exists. The subsequent access to a semaphore within the set may then be out of bounds.

An unprivileged local user can trigger an out-of-bounds access on kernel heap memory, potentially leading to privilege escalation.

Analysis

AI-generated

Technical impact

The flaw is a heap out‑of‑bounds write that occurs within the kernel semaphore system call `semop(2)` when a waiting process is awakened after the semaphore set has been destroyed and re‑created enough times to wrap a 15‑bit sequence number. The overwritten location lies in kernel heap memory and can corrupt critical data structures, giving an unprivileged local user the ability to gain elevated privileges. The issue is a classic example of CWE‑787 and is a direct out‑of‑bounds memory corruption vulnerability. The impact is a local privilege escalation because the corruption happens inside the kernel address space and can lead to arbitrary code execution with root rights.

Affected Systems

The defect resides in the FreeBSD kernel semaphore implementation and applies to all FreeBSD releases that contain the unpatched IPC subsystem. The advisory lists only the generic product “FreeBSD” with no specific version range, so any system running a kernel prior to the update that resolves this issue is considered vulnerable. No particular product or vendor beyond FreeBSD is mentioned.

Risk and Exploitability

The vulnerability is local and requires the attacker to have some form of local access. The exploit does not depend on network interaction; it is triggered by creating and destroying semaphore sets until the 15‑bit sequence counter wraps. The resulting kernel‑heap out‑of‑bounds write makes the flaw a high‑severity privilege escalation with a CVSS score of 8.4. The EPSS score is < 1%, indicating a very low likelihood of exploitation in the wild, and the bug is not listed in the CISA KEV catalog. However, the local nature of the attack still poses a serious risk to systems that cannot restrict IPC usage.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest FreeBSD security update that resolves FreeBSD-SA-26:64.sysvsem, ensuring the kernel semaphore implementation is patched.
  • If a patch cannot be applied immediately, temporarily restrict unprivileged users from creating or manipulating semaphore sets by disabling the IPC semaphore subsystem via sysctl (e.g., set the semaphore enable flag to 0) until the update is installed.
  • Audit kernel and system logs for unexpected semaphore activity and consider isolating untrusted processes or applying additional hardening such as disabling shared memory IPC if not required for your environment.

Generated by OpenCVE AI on October 16, 2026 at 22:16 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:o:freebsd:freebsd:14.4:-:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p1:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p2:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p3:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p4:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p5:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p6:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p7:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p8:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.4:p9:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:14.5:-:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:-:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p10:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p11:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p12:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p13:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p1:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p2:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p3:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p4:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p5:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p6:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p7:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p8:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.0:p9:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.1:-:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.1:p1:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.1:p2:*:*:*:*:*:*
cpe:2.3:o:freebsd:freebsd:15.1:p3:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Freebsd
Freebsd freebsd
Vendors & Products Freebsd
Freebsd freebsd
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description When semop(2) blocks waiting for a semaphore condition, it releases the per-set lock and sleeps. Upon waking, it checks the sequence number embedded in the semaphore set's IPC identifier to detect whether the set was removed while the caller was asleep. This sequence number is only 15 bits wide. If enough semaphore sets are created and destroyed in the same table slot while a caller is blocked, the counter wraps around, and semop(2) may falsely conclude that the original set still exists. The subsequent access to a semaphore within the set may then be out of bounds. An unprivileged local user can trigger an out-of-bounds access on kernel heap memory, potentially leading to privilege escalation.
Title Heap out-of-bounds access in semop(2)
Weaknesses CWE-787
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
freebsd
Published
Updated
Oct 16, 2026, 2:16 PM
Reserved
Jun 29, 2026, 1:40 AM
Status
Analyzed
Published
Oct 15, 2026, 7:18 AM
Modified
Oct 19, 2026, 9:05 PM