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.

Severity (CVSS 3.1)4.8Medium
Exploit odds (30 days)1.0%top 36.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Alpine:v3.20gcc13.2.1_git20231014-r0ALPINE-CVE-2023-4039
Alpine:v3.21gcc13.2.1_git20231014-r0ALPINE-CVE-2023-4039
Alpine:v3.22gcc13.2.1_git20231014-r0ALPINE-CVE-2023-4039
Alpine:v3.23gcc13.2.1_git20231014-r0ALPINE-CVE-2023-4039
Alpine:v3.24gcc13.2.1_git20231014-r0ALPINE-CVE-2023-4039
Debian:12gcc-11no fix listedDEBIAN-CVE-2023-4039
Debian:12gcc-1212.2.0-14+deb12u1DEBIAN-CVE-2023-4039
Debian:13gcc-1212.3.0-9DEBIAN-CVE-2023-4039
Debian:14gcc-1212.3.0-9DEBIAN-CVE-2023-4039
Debian:13gcc-1313.2.0-4DEBIAN-CVE-2023-4039
Debian:14gcc-1313.2.0-4DEBIAN-CVE-2023-4039
Ubuntu:22.04:LTSgcc-1010.5.0-1ubuntu1~22.04.2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-1010.5.0-1ubuntu1~22.04.2USN-7700-1
Ubuntu:24.04:LTSgcc-1010.5.0-4ubuntu2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-10-crossno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-10-cross23ubuntu2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-10-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-10-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-1111.4.0-1ubuntu1~22.04.2USN-7700-1
Ubuntu:22.04:LTSgcc-1111.4.0-1ubuntu1~22.04.2UBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-1111.4.0-4ubuntu1UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-11-crossno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-11-cross21ubuntu2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-11-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-11-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:25.10gcc-11-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.04:LTSgcc-11-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.10gcc-11-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-1212.3.0-1ubuntu1~22.04.2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-1212.3.0-1ubuntu1~22.04.2USN-7700-1
Ubuntu:22.04:LTSgcc-12-crossno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-12-cross19ubuntu2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-12-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-12-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:25.10gcc-12-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.04:LTSgcc-12-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.10gcc-12-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-9no fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-99.5.0-6ubuntu2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-9-crossno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-9-cross29ubuntu2UBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-9-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-9-cross-portsno fix listedUBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-optno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-optno fix listedUBUNTU-CVE-2023-4039
Ubuntu:25.10gcc-optno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.04:LTSgcc-optno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.10gcc-optno fix listedUBUNTU-CVE-2023-4039
Ubuntu:22.04:LTSgcc-snapshotno fix listedUBUNTU-CVE-2023-4039
Ubuntu:24.04:LTSgcc-snapshotno fix listedUBUNTU-CVE-2023-4039
Ubuntu:25.10gcc-snapshotno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.04:LTSgcc-snapshotno fix listedUBUNTU-CVE-2023-4039
Ubuntu:26.10gcc-snapshotno fix listedUBUNTU-CVE-2023-4039

Affected products (as reported)

VendorProductVersions
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