CVE-2023-4039

Public Exploit
GCC's-fstack-protector fails to guard dynamically-sized local variables on AArch64

Description

**DISPUTED**A failure in the -fstack-protector feature in GCC-based toolchains that target AArch64 allows an attacker to exploit an existing buffer overflow in dynamically-sized local variables in your application without this being detected. This stack-protector failure only applies to C99-style dynamically-sized local variables or those created using alloca(). The stack-protector operates as intended for statically-sized local variables. The default behavior when the stack-protector detects an overflow is to terminate your application, resulting in controlled loss of availability. An attacker who can exploit a buffer overflow without triggering the stack-protector might be able to change program flow control to cause an uncontrolled loss of availability or to go further and affect confidentiality or integrity. NOTE: The GCC project argues that this is a missed hardening bug and not a vulnerability by itself.

Remediation

Solution:

  • Recompile vulnerable code using an updated toolchain.

Category

4.8
CVSS
Severity: Medium
CVSS 3.1 •
EPSS 0.12%
Third-Party Advisory arm.com Third-Party Advisory github.com
Affected: Arm Ltd Arm GNU Toolchain
Affected: GNU GCC
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-4039?
CVE-2023-4039 has been scored as a medium severity vulnerability.
How to fix CVE-2023-4039?
To fix CVE-2023-4039: Recompile vulnerable code using an updated toolchain.
Is CVE-2023-4039 being actively exploited in the wild?
It is possible that CVE-2023-4039 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-4039?
CVE-2023-4039 affects Arm Ltd Arm GNU Toolchain, GNU GCC.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.