CVE-2023-5941 libc stdio buffer overflow

Critical 9.8 Published Updated

A heap buffer overflow in FreeBSD's libc stdio functions allows attackers to execute arbitrary code or corrupt data via write errors.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2023-5941?

CVE-2023-5941 is a critical memory corruption vulnerability in Freebsd Freebsd, published on 8 Nov 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-787, CWE-131

Which versions are affected by CVE-2023-5941?

It affects 1 product.

Products include Freebsd Freebsd.

How do I fix CVE-2023-5941?

No fix has been published for CVE-2023-5941 yet. Limit exposure of the affected software until one is available.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2023-5941 being exploited?

There is no known exploitation of CVE-2023-5941 in the wild and no public exploit code.

All Freebsd Freebsd vulnerabilities

Sources

Also known as GHSA-wxrq-hw6f-m4w8.

Is CVE-2023-5941 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free