# CVE-2023-4039: GCC's-fstack-protector fails to guard dynamically-sized local variables on AArch64

- Severity: Medium 4.8 (CVSS:3.1, scored by Arm) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`
- 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.03%, higher than 64% of CVEs (2026-12-02)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2023-09-13T08:05:10.274Z
- Modified: 2026-10-14T22:17:17.000Z
- Weaknesses: CWE-693
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: Arm

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

(As written by CVE List.)

## Affected

- Arm Ltd Arm GNU Toolchain: All versions where option -fstack-protector is used
- GNU GCC: All versions of GCC that target AArch64 when option -fstack-protector is used; before 2023-09-12

## Every score

- Arm: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`

## References

- <https://developer.arm.com/Arm%20Security%20Center/GCC%20Stack%20Protector%20Vulnerability%20AArch64> (exploit, patch, third-party-advisory)
- <https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-x7ch-h5rf-w2mf> (exploit, patch, third-party-advisory)
- <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-355557.html>

## Sources

- CVE List: [CVE-2023-4039](https://www.cve.org/CVERecord?id=CVE-2023-4039), CVE Terms of Use, modified 2026-10-14
- NVD: [CVE-2023-4039](https://nvd.nist.gov/vuln/detail/CVE-2023-4039), Public domain, modified 2026-10-14

---

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