Skip to main content
Public proof of conceptFix available

CVE-2023-4039

A public proof of concept exists; no exploitation attested.

  • Published2023-09-13
  • Fixed in2023-09-12
  • WeaknessCWE-693

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2023-09-1309:15CVE publishedNVD

Versions per branch

NVD
Gnu gcc
BranchAffectedFixed in
2023.x< 2023-09-122023-09-12

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA2 products

As Arm, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • Arm Ltd Arm GNU Toolchainother versions: affected
    Affected
    • = All versions where option -fstack-protector is usedno fix stated
  • GNU GCCother versions: not affected
    Affected
    • = All versions of GCC that target AArch64 when option -fstack-protector is usedno fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2024-06-13

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • cross-nvptx-gcc13SUSE:Linux Enterprise Module for Development Tools 15 SP5all versions · fixed in 13.2.1+git7813-150000.1.3.2
  • cross-nvptx-gcc13SUSE:Linux Enterprise Module for Development Tools 15 SP4all versions · fixed in 13.2.1+git7813-150000.1.3.2
  • cross-nvptx-gcc13openSUSE:Leap 15.5all versions · fixed in 13.2.1+git7813-150000.1.3.2
  • cross-nvptx-gcc13openSUSE:Leap 15.4all versions · fixed in 13.2.1+git7813-150000.1.3.2
  • gccWolfiall versions · fixed in 13.2.0-r3and 12 other packages
  • gccopenEuler:24.03-LTSall versions · fixed in 12.3.1-38.oe2403
  • gccopenEuler:22.03-LTS-SP2all versions · fixed in 10.3.1-38.oe2203sp2
  • gccopenEuler:22.03-LTS-SP1all versions · fixed in 10.3.1-25.oe2203sp1

143 more package ranges on OSV.dev

Vendor advisories

  • CVE-2023-4039 Red Hat Product Security88 known affected

    gcc: -fstack-protector fails to guard dynamic stack allocations on ARM64

    gcc.src as a component of Red Hat Advanced Cluster Management for Kubernetes 2 · compat-gcc-34-c++ as a component of Red Hat Enterprise Linux 6 · compat-gcc-34-g77 as a component of Red Hat Enterprise Linux 6 · +85 more

  • ICSA-25-226-07 CISA3 known affected

    Siemens Third-Party Components in SINEC OS

    RUGGEDCOM RST2428P (6GK6242-6PA00) · SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family · SCALANCE XCM-/XRM-/XCH-/XRH-300 family

  • SSA-355557 Siemens ProductCERT3 known affected

    SSA-355557: Multiple Vulnerabilities in Third-Party Components in SINEC OS before V3.2

    RUGGEDCOM RST2428P (6GK6242-6PA00) · SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family · SCALANCE XCM-/XRM-/XCH-/XRH-300 family

  • ICSA-23-348-10 CISA5 known affected

    Siemens SIMATIC S7-1500

    SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) · SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) · SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) · +2 more

  • SSA-398330 Siemens ProductCERT5 known affected

    SSA-398330: Vulnerabilities in the additional GNU/Linux subsystem of the SIMATIC S7-1500 CPU 1518(F)-4 PN/DP MFP >= V3.1.0 and < V3.1.5

    SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) >= V3.1.0 < V3.1.5 · SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) >= V3.1.0 < V3.1.5 · SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) >= V3.1.0 < V3.1.5 · +2 more

Full record on NVD

Fix

  1. Update Gnu gcc to 2023-09-12
  2. Vendor fix Siemens ProductCERT SSA-355557 · 2 productsUpdate to V3.2 or later version
  3. Vendor fix Siemens ProductCERT SSA-355557 · 1 productSee Section Additional Information.
  4. Vendor fix CISA ICSA-25-226-07 · 2 productsUpdate to V3.2 or later version
  5. Vendor fix CISA ICSA-25-226-07 · 1 productSee Section Additional Information.
  6. Vendor fix CISA ICSA-23-348-10 · 5 productsUpdate to V3.1.5 or later version
  7. Vendor fix Siemens ProductCERT SSA-398330 · 1 productUpdate to V3.1.5 or later version

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • CISA-ADPSSVC decisionpoc2025-06-03
  • CNACVSS 3.14.8known since 2026-10-23
  • NVDCVSS 3.14.8read 2026-10-23
  • CNAweakness (CWE)CWE-693known since 2026-10-23
  • FIRST EPSSEPSS score1.0 %2026-11-08
  • OSVaffected packages—

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
Published
2023-09-13
Last Modified
2026-10-14
NVD status
Modified

Frequently asked questions

What is CVE-2023-4039?

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

Is CVE-2023-4039 actively exploited?

A proof-of-concept exploit exists for CVE-2023-4039, but active exploitation has not been confirmed at this time.

What is the CVSS score for CVE-2023-4039?

CVE-2023-4039 has a CVSS v3 base score of 4.8 (MEDIUM severity), with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.

Running gcc? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record