BreachSpiderVerified, not vibes

CVE-2023-5941 in Freebsd

Critical 9.8

In versions of FreeBSD 12.4-RELEASE prior to 12.4-RELEASE-p7 and FreeBSD 13.2-RELEASE prior to 13.2-RELEASE-p5 the __sflush() stdio function in libc does not correctly update FILE objects' write space members for write-buffered streams when the write(2) system call returns an error.  Depending on the nature of an ap...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.19.8
EPSS1.3%
EPSS percentile70th
FixSee advisory

Remotely exploitable over the network, low complexity, no authentication required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Freebsd Freebsd 12.4 13.2 < 12.4 ≥ 13.0, < 13.2

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

View Vendor Advisory →

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official description

In versions of FreeBSD 12.4-RELEASE prior to 12.4-RELEASE-p7 and FreeBSD 13.2-RELEASE prior to 13.2-RELEASE-p5 the __sflush() stdio function in libc does not correctly update FILE objects' write space members for write-buffered streams when the write(2) system call returns an error.  Depending on the nature of an application that calls libc's stdio functions and the presence of errors returned from the write(2) system call (or an overridden stdio write routine) a heap buffer overflow may occur. Such overflows may lead to data corruption or the execution of arbitrary code at the privilege level of the calling program.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2023-5941
BreachSpider IDBS-2023-GLOBAL-054565-C
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Published2023-11-08
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-131: CWE-131

CWE-787: Out-of-Bounds Write

Software writes data past buffer boundaries, corrupting memory and potentially enabling code execution.

Related attack patterns (CAPEC)

CAPEC-47 Buffer Overflow via Parameter Expansion via CWE-131

CAPEC-100 Overflow Buffers via CWE-131

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

A vulnerability in the __sflush() stdio function in libc of FreeBSD versions 12.4-RELEASE prior to 12.4-RELEASE-p7 and 13.2-RELEASE prior to 13.2-RELEASE-p5 can lead to incorrect handling of write errors, potentially allowing for data corruption or unauthorized access.

An attacker could exploit this vulnerability by causing the write(2) system call to return an error, leading to incorrect updates in FILE objects' write space members. This could be achieved through various means, such as manipulating file descriptors or network conditions in applications that use the affected stdio functions.

Questions

What is CVE-2023-5941?

A vulnerability in the __sflush() stdio function in libc of FreeBSD versions 12.4-RELEASE prior to 12.4-RELEASE-p7 and 13.2-RELEASE prior to 13.2-RELEASE-p5 can lead to incorrect handling of write errors, potentially allowing for data corruption or unauthorized access.

What is the CVSS score for CVE-2023-5941?

CVE-2023-5941 has CVSS 9.8 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. EPSS: 1.3%.

Is CVE-2023-5941 actively exploited?

No confirmed active exploitation of CVE-2023-5941 as of 2026-09-25.

How do I remediate CVE-2023-5941?

Priority: IMMEDIATE. Advisory: https://security.freebsd.org/advisories/FreeBSD-SA-23:15.stdio.asc

What systems are affected by CVE-2023-5941?

CVE-2023-5941 affects Freebsd Freebsd.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Freebsd","product":"Freebsd","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.