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

Published Sep 12, 2023
·
Updated

DISPUTEDA 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 Software

100 affected componentsFixes available
GNU gcc<2023-09-12
debian/gcc-11*
debian/gcc-12<12.2.0-14+deb12u1
12.2.0-14+deb12u1
debian/gcc-12<12.3.0-9
12.3.0-9
debian/gcc-13<13.2.0-4
13.2.0-4
debian/gcc-13<13.2.0-4
13.2.0-4
debian/gcc-11<=11.3.0-12
11.5.0-14
debian/gcc-12
12.2.0-14+deb12u112.4.0-512.5.0-12
debian/gcc-13
13.3.0-1613.5.0-4
ubuntu/gcc-4.7*
ubuntu/gcc-4.8*
ubuntu/gcc-mingw-w64*
ubuntu/gccgo-4.9*
ubuntu/gcc-5*
ubuntu/gcc-5-cross*
ubuntu/gccgo-6*
ubuntu/gcc-4.7*
ubuntu/gcc-4.7-armel-cross*
ubuntu/gcc-4.7-armhf-cross*
ubuntu/gcc-4.8*
ubuntu/gcc-4.8-arm64-cross*
ubuntu/gcc-4.8-armhf-cross*
ubuntu/gcc-4.8-powerpc-cross*
ubuntu/gcc-4.8-ppc64el-cross*
ubuntu/gcc-4.9-cross*
ubuntu/gcc-5-cross-ports*
ubuntu/gcc-arm-linux-androideabi*
ubuntu/gcc-arm-none-eabi*
ubuntu/gcc-avr*
ubuntu/gcc-h8300-hms*
ubuntu/gcc-i686-linux-android*
ubuntu/gcc-m68hc1x*
ubuntu/gcc-mingw-w64*
ubuntu/gcc-msp430*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-7*
ubuntu/gcc-7-cross*
ubuntu/gcc-8*
ubuntu/gcc-8-cross*
ubuntu/gcc-4.8*
ubuntu/gcc-5*
ubuntu/gcc-5-cross*
ubuntu/gcc-5-cross-ports*
ubuntu/gcc-6-cross*
ubuntu/gcc-6-cross-ports*
ubuntu/gcc-7-cross-ports*
ubuntu/gcc-8-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-10<10.5.0-1ubuntu1~20.04.1+esm1
10.5.0-1ubuntu1~20.04.1+esm1
ubuntu/gcc-10-cross*
ubuntu/gcc-9*
ubuntu/gcc-9-cross*
ubuntu/gcc-10-cross-ports*
ubuntu/gcc-7*
ubuntu/gcc-8*
ubuntu/gcc-8-cross*
ubuntu/gcc-8-cross-ports*
ubuntu/gcc-9-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-10<10.5.0-1ubuntu1~22.04.2
10.5.0-1ubuntu1~22.04.2
ubuntu/gcc-10-cross*
ubuntu/gcc-10-cross-ports*
ubuntu/gcc-11<11.4.0-1ubuntu1~22.04.2
11.4.0-1ubuntu1~22.04.2
ubuntu/gcc-11-cross-ports*
ubuntu/gcc-12<12.3.0-1ubuntu1~22.04.2
12.3.0-1ubuntu1~22.04.2
ubuntu/gcc-12-cross*
ubuntu/gcc-12-cross-ports*
ubuntu/gcc-9*
ubuntu/gcc-9-cross*
ubuntu/gcc-9-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-10<10.5.0-4ubuntu2
10.5.0-4ubuntu2
ubuntu/gcc-10-cross<23ubuntu2
23ubuntu2
ubuntu/gcc-10-cross-ports*
ubuntu/gcc-11<11.4.0-4ubuntu1
11.4.0-4ubuntu1
ubuntu/gcc-11-cross<21ubuntu2
21ubuntu2
ubuntu/gcc-11-cross-ports*
ubuntu/gcc-12-cross<19ubuntu2
19ubuntu2
ubuntu/gcc-12-cross-ports*
ubuntu/gcc-9<9.5.0-6ubuntu2
9.5.0-6ubuntu2
ubuntu/gcc-9-cross<29ubuntu2
29ubuntu2
ubuntu/gcc-9-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-11-cross-ports*
ubuntu/gcc-12-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-11-cross-ports*
ubuntu/gcc-12-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*
ubuntu/gcc-11-cross-ports*
ubuntu/gcc-12-cross-ports*
ubuntu/gcc-opt*
ubuntu/gcc-snapshot*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/gcc-12 to a version that resolves this vulnerability.

    Fixed in 12.2.0-14+deb12u1
  2. Upgrade

    Upgrade debian/gcc-12 to a version that resolves this vulnerability.

    Fixed in 12.3.0-9
  3. Upgrade

    Upgrade debian/gcc-13 to a version that resolves this vulnerability.

    Fixed in 13.2.0-4
  4. Upgrade

    Upgrade debian/gcc-11 to a version that resolves this vulnerability.

    Fixed in 11.5.0-14
  5. Upgrade

    Upgrade debian/gcc-12 to a version that resolves this vulnerability.

    Fixed in 12.2.0-14+deb12u1Fixed in 12.4.0-5Fixed in 12.5.0-12
  6. Upgrade

    Upgrade debian/gcc-13 to a version that resolves this vulnerability.

    Fixed in 13.3.0-16Fixed in 13.5.0-4
  7. Upgrade

    Upgrade ubuntu/gcc-10 to a version that resolves this vulnerability.

    Fixed in 10.5.0-1ubuntu1~20.04.1+esm1
  8. Upgrade

    Upgrade ubuntu/gcc-10 to a version that resolves this vulnerability.

    Fixed in 10.5.0-1ubuntu1~22.04.2
  9. Upgrade

    Upgrade ubuntu/gcc-11 to a version that resolves this vulnerability.

    Fixed in 11.4.0-1ubuntu1~22.04.2
  10. Upgrade

    Upgrade ubuntu/gcc-12 to a version that resolves this vulnerability.

    Fixed in 12.3.0-1ubuntu1~22.04.2
  11. Upgrade

    Upgrade ubuntu/gcc-10 to a version that resolves this vulnerability.

    Fixed in 10.5.0-4ubuntu2
  12. Upgrade

    Upgrade ubuntu/gcc-10-cross to a version that resolves this vulnerability.

    Fixed in 23ubuntu2
  13. Upgrade

    Upgrade ubuntu/gcc-11 to a version that resolves this vulnerability.

    Fixed in 11.4.0-4ubuntu1
  14. Upgrade

    Upgrade ubuntu/gcc-11-cross to a version that resolves this vulnerability.

    Fixed in 21ubuntu2
  15. Upgrade

    Upgrade ubuntu/gcc-12-cross to a version that resolves this vulnerability.

    Fixed in 19ubuntu2
  16. Upgrade

    Upgrade ubuntu/gcc-9 to a version that resolves this vulnerability.

    Fixed in 9.5.0-6ubuntu2
  17. Upgrade

    Upgrade ubuntu/gcc-9-cross to a version that resolves this vulnerability.

    Fixed in 29ubuntu2
  18. Operational

    Recompile vulnerable code using an updated GCC-based toolchain targeting AArch64.

Event History

Sep 12, 2023
CVE Published
via OSV·03:00 PM
Data Sourced
via OSV·03:00 PM
DescriptionSeverityAffected Software
Sep 13, 2023
CVE Published
via MITRE·08:05 AM
Data Sourced
via MITRE·08:05 AM
RemedyDescriptionSeverityWeakness
Data Sourced
09:15 AM
DescriptionSeverityWeakness
Sep 14, 2023
Data Sourced
08:01 PM
RemedyAffected Software
Updated
08:01 PM
Severity
Feb 19, 2024
Disputed
via NVD·11:15 PM
Data Sourced
via NVD·11:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 13, 2024
Disputed
via NVD·11:15 PM
Updated
via NVD·11:15 PM
Affected Software
Aug 2, 2024
Disputed
via NVD·08:15 AM
Updated
via NVD·08:15 AM
Affected Software
Nov 21, 2024
Disputed
via NVD·08:34 AM
Updated
via NVD·08:34 AM
RemedyAffected Software
Feb 13, 2025
Disputed
via NVD·05:17 PM
Updated
via NVD·05:17 PM
DescriptionAffected Software
Jun 23, 2026
Updated
via MITRE·05:19 PM
RemedyDescription
Disputed
via NVD·06:17 PM
Updated
via NVD·06:17 PM
Affected Software
Oct 14, 2026
Disputed
via NVD·10:17 PM

Frequently Asked Questions

1

What is CVE-2023-4039?

CVE-2023-4039 is a vulnerability that affects GCC-based toolchains targeting AArch64, allowing an attacker to exploit buffer overflows in dynamically-sized local variables.

2

What does the -fstack-protector feature in GCC-based toolchains do?

The -fstack-protector feature in GCC-based toolchains provides protection against stack buffer overflows by adding canaries, or integrity checks, to the stack.

3

What is the impact of CVE-2023-4039?

The impact of CVE-2023-4039 is that an attacker can exploit buffer overflows in dynamically-sized local variables without detection.

4

How can I protect my application from CVE-2023-4039?

To protect your application from CVE-2023-4039, make sure to update your GCC-based toolchain to a version that includes the fix for this vulnerability.

5

Where can I find more information about CVE-2023-4039?

You can find more information about CVE-2023-4039 on the Arm Security Center website and the GitHub Advisory database.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203