CVE-2023-5941
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedIn 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceHeap buffer overflow in FreeBSD libc's __sflush() function. When write(2) returns an error, the function fails to properly update FILE structure members for write-buffered streams, allowing overflow into adjacent heap memory. This can lead to data corruption or arbitrary code execution at the application's privilege level.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 12.4>= 13.0, < 13.2= 12.4= 13.2CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check the running FreeBSD kernel versionRun `uname -a` and note the version string (e.g., 12.4-RELEASE or 13.2-RELEASE)Affected if The version shows FreeBSD 12.x before 12.4-RELEASE-p7, or FreeBSD 13.x before 13.2-RELEASE-p5, or any version earlier than 12.4 or between 13.0 and 13.1
-
Check the installed FreeBSD base system versionRun `freebsd-version -k` to get the installed kernel versionAffected if The output indicates an unpatched version matching the vulnerable ranges above
-
Verify the libc library patch levelRun `freebsd-version` (without flags) to see both running and installed versions, or check for patch level in `uname -a` output after -p (e.g., -p7)Affected if The patch level number (after -p) is less than 7 for 12.4, or less than 5 for 13.2, or absent entirely for versions in the affected range
If the system runs FreeBSD 12.x < 12.4-RELEASE-p7 or FreeBSD 13.x < 13.2-RELEASE-p5, the libc containing the vulnerable __sflush() code is present.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped12.413.2
Apply FreeBSD security patches: upgrade to 12.4-RELEASE-p7 or 13.2-RELEASE-p5 or later. This is a libc library update requiring system reboot or service restart to take effect.
FreeBSD 12.4-RELEASE-p7 or FreeBSD 13.2-RELEASE-p5 (via freebsd-update or source rebuild)
- Run 'freebsd-version -u' to confirm your current FreeBSD version
- For FreeBSD 12.x systems: Run 'freebsd-update fetch install' to update to 12.4-RELEASE-p7 or later
- For FreeBSD 13.x systems: Run 'freebsd-update fetch install' to update to 13.2-RELEASE-p5 or later
- Alternatively, rebuild world and kernel from source using 'make buildworld buildkernel' and install with 'make installworld installkernel' from branches/releng/12_4 or branches/releng/13_2 after patches are applied
- Reboot the system after applying updates
- Verify the patch level with 'uname -a' to confirm the p7 or p5 patch level is installed
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation3.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,272.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2023-5941 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2023-5941 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data