# CVE-2023-5941: libc stdio buffer overflow

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.21%, higher than 69% of CVEs (2026-12-02)
- Published: 2023-11-08T08:52:26.564Z
- Modified: 2026-06-17T06:49:42.567Z
- Weaknesses: CWE-131, CWE-787
- Assigned by: freebsd

## 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.

(As written by CVE List.)

## Affected

- FreeBSD FreeBSD: from 12.4-RELEASE before p7; from 13.2-RELEASE before p5; before 12.4; from 13.0 before 13.2; 12.4; 13.2

## References

- <https://security.freebsd.org/advisories/FreeBSD-SA-23:15.stdio.asc> (vendor-advisory)
- <https://security.netapp.com/advisory/ntap-20231214-0004/>

## Sources

- CVE List: [CVE-2023-5941](https://www.cve.org/CVERecord?id=CVE-2023-5941), CVE Terms of Use, modified 2025-02-13
- NVD: [CVE-2023-5941](https://nvd.nist.gov/vuln/detail/CVE-2023-5941), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-5941 · Whole record: https://cve.day/CVE-2023-5941.json · Rebuilt by cve.day 2026-11-25T22:58:30.208Z
