Vulnerability · Published Sep 13, 2023 · Assigned by Arm
CVE-2023-4039GCC's-fstack-protector fails to guard dynamically-sized local variables on AArch64
Medium 4.8
In plain English
A medium-severity security flaw in Arm GNU Toolchain from Arm Ltd. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.0% (higher than 64% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | gcc | 13.2.1_git20231014-r0 | ALPINE-CVE-2023-4039 |
| Alpine:v3.21 | gcc | 13.2.1_git20231014-r0 | ALPINE-CVE-2023-4039 |
| Alpine:v3.22 | gcc | 13.2.1_git20231014-r0 | ALPINE-CVE-2023-4039 |
| Alpine:v3.23 | gcc | 13.2.1_git20231014-r0 | ALPINE-CVE-2023-4039 |
| Alpine:v3.24 | gcc | 13.2.1_git20231014-r0 | ALPINE-CVE-2023-4039 |
| Debian:12 | gcc-11 | no fix listed | DEBIAN-CVE-2023-4039 |
| Debian:12 | gcc-12 | 12.2.0-14+deb12u1 | DEBIAN-CVE-2023-4039 |
| Debian:13 | gcc-12 | 12.3.0-9 | DEBIAN-CVE-2023-4039 |
| Debian:14 | gcc-12 | 12.3.0-9 | DEBIAN-CVE-2023-4039 |
| Debian:13 | gcc-13 | 13.2.0-4 | DEBIAN-CVE-2023-4039 |
| Debian:14 | gcc-13 | 13.2.0-4 | DEBIAN-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-10 | 10.5.0-1ubuntu1~22.04.2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-10 | 10.5.0-1ubuntu1~22.04.2 | USN-7700-1 |
| Ubuntu:24.04:LTS | gcc-10 | 10.5.0-4ubuntu2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-10-cross | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-10-cross | 23ubuntu2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-10-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-10-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-11 | 11.4.0-1ubuntu1~22.04.2 | USN-7700-1 |
| Ubuntu:22.04:LTS | gcc-11 | 11.4.0-1ubuntu1~22.04.2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-11 | 11.4.0-4ubuntu1 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-11-cross | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-11-cross | 21ubuntu2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-11-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-11-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:25.10 | gcc-11-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.04:LTS | gcc-11-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.10 | gcc-11-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-12 | 12.3.0-1ubuntu1~22.04.2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-12 | 12.3.0-1ubuntu1~22.04.2 | USN-7700-1 |
| Ubuntu:22.04:LTS | gcc-12-cross | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-12-cross | 19ubuntu2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-12-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-12-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:25.10 | gcc-12-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.04:LTS | gcc-12-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.10 | gcc-12-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-9 | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-9 | 9.5.0-6ubuntu2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-9-cross | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-9-cross | 29ubuntu2 | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-9-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-9-cross-ports | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-opt | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-opt | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:25.10 | gcc-opt | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.04:LTS | gcc-opt | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.10 | gcc-opt | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:22.04:LTS | gcc-snapshot | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:24.04:LTS | gcc-snapshot | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:25.10 | gcc-snapshot | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.04:LTS | gcc-snapshot | no fix listed | UBUNTU-CVE-2023-4039 |
| Ubuntu:26.10 | gcc-snapshot | no fix listed | UBUNTU-CVE-2023-4039 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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 |
Weakness: CWE-693 · Vector: 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
- https://github.com/metaredteam/external-disclosures/security/advisories/GHSA-x7ch-h5rf-w2mf
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://cert-portal.siemens.com/productcert/html/ssa-355557.html