Cloudanix VulnDB

CVE-2023-4039

Medium · 4.8

CVSS

4.8

EPSS

1.0%

Published

Sep 13, 2023

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A compiler safety check on certain chips fails to catch memory mistakes in some kinds of temporary storage, letting attackers more easily crash programs or take them over.

Exploit Available Chainable
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Data Tampering
Component
Other
Class
Buffer Overflow
Remediation
No Fix Yet
Effort
Other
Patch risk
Other

What it actually does

The -fstack-protector feature in GCC-based toolchains for AArch64 fails to insert or validate stack canaries for C99-style dynamically-sized local variables or buffers allocated via alloca(), allowing existing buffer overflows in those locations to proceed undetected while static-sized variables remain protected.

Why it matters to the business

Applications built with affected GCC versions on AArch64 face elevated risk that memory corruption bugs can be leveraged for crashes, control-flow hijacking, or data exposure without the expected termination safeguard, increasing potential downtime and remediation costs across embedded, mobile, and server workloads.

How an attack unfolds

An attacker locates a buffer overflow in a dynamically-sized local variable or alloca buffer within an AArch64 binary compiled by vulnerable GCC, supplies oversized input that overwrites adjacent memory without triggering the missing canary check, and redirects execution to achieve denial of service or further confidentiality and integrity impacts.

How to fix it

Rebuild affected code with updated GCC toolchains once a fix is released; in the interim avoid dynamic-sized locals and alloca in security-sensitive functions, enable complementary mitigations such as ASLR, PAC, and BTI, and review compiler flags to ensure -fstack-protector-strong is applied where possible.

How to confirm the fix worked

Inspect build logs and source for use of variable-length arrays or alloca on AArch64 targets, compile test cases with known overflows under -fstack-protector and observe whether the process is terminated, and verify canary insertion via objdump or readelf on resulting binaries.

Typical attack path

  1. Identify AArch64 target binary compiled with GCC that contains a buffer overflow in a dynamic local variable or alloca allocation
  2. Craft input that overflows the buffer without canary validation
  3. Overwrite adjacent stack data or return addresses to alter program flow
  4. Trigger uncontrolled crash or execute attacker-controlled code

How to detect it

Search application and system logs for unexpected terminations or segmentation faults in AArch64 processes, correlate with network or input events that could trigger buffer overflows, and examine core dumps for stack layout anomalies consistent with undetected overflows.

What your security team should do

  • Inventory all AArch64 build pipelines using GCC and flag those relying on dynamic locals
  • Prioritize code audits and refactoring to eliminate alloca and VLA usage in network-facing components
  • Enable additional hardware and software exploit mitigations on AArch64 systems
  • Track upstream GCC discussions for any future hardening changes

The record

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

Ecosystem Package Introduced Fixed
Alpine:v3.19 gcc 0 13.2.1_git20231014-r0
Alpine:v3.20 gcc 0 13.2.1_git20231014-r0
Alpine:v3.21 gcc 0 13.2.1_git20231014-r0
Alpine:v3.22 gcc 0 13.2.1_git20231014-r0
Chainguard gcc 0 13.2.0-r3
Chainguard gcc-12 0 12.3.0-r4
Chainguard gcc-12-default 0 12.3.0-r4
Chainguard gcc-12-doc 0 12.3.0-r4
Chainguard gcc-6 0 6.5.0-r5
Chainguard gcc-6-doc 0 6.5.0-r5
Chainguard gcc-doc 0 13.2.0-r3
Chainguard gcc-go 0 13.2.0-r3
Chainguard gcc-objc 0 13.2.0-r3
Chainguard gcj-6 0 6.5.0-r5
Chainguard gfortran 0 13.2.0-r3
Chainguard libatomic 0 13.2.0-r3
Chainguard libgcc 0 13.2.0-r3
Chainguard libgccjit 0 13.2.0-r3
Chainguard libgccjit-dev 0 13.2.0-r3
Chainguard libgcj-6 0 6.5.0-r5
Chainguard libgfortran 0 13.2.0-r3
Chainguard libgo 0 13.2.0-r3
Chainguard libgomp 0 13.2.0-r3
Chainguard libobjc 0 13.2.0-r3
Chainguard libquadmath 0 13.2.0-r3
Chainguard libssp 0 13.2.0-r3
Chainguard libstdc++ 0 13.2.0-r3
Chainguard libstdc++-12 0 12.3.0-r4
Chainguard libstdc++-12-dev 0 12.3.0-r4
Chainguard libstdc++-6 0 6.5.0-r5
Chainguard libstdc++-6-dev 0 6.5.0-r5
Chainguard libstdc++-dev 0 13.2.0-r3
Debian:11 gcc-10 0 No fix
Debian:11 gcc-9 0 No fix
Debian:12 gcc-11 0 No fix
Debian:12 gcc-12 0 No fix
Debian:13 gcc-11 0 11.4.0-4
Debian:13 gcc-12 0 12.3.0-9
Debian:13 gcc-13 0 13.2.0-4
Debian:14 gcc-12 0 12.3.0-9
Debian:14 gcc-13 0 13.2.0-4
SUSE:Enterprise Storage 7 cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Enterprise Storage 7 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Enterprise Storage 7.1 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Enterprise Storage 7.1 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS gcc12-testresults 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Installer Updates 15 SP1 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Installer Updates 15 SP1 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Installer Updates 15 SP2 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Installer Updates 15 SP2 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Installer Updates 15 SP2 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Installer Updates 15 SP3 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Installer Updates 15 SP3 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Installer Updates 15 SP3 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Installer Updates 15 SP4 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Installer Updates 15 SP4 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Installer Updates 15 SP4 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Installer Updates 15 SP5 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Installer Updates 15 SP5 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Micro 5.1 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Micro 5.1 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Micro 5.1 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Micro 5.2 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Micro 5.2 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Micro 5.2 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Micro 5.3 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Micro 5.3 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Micro 5.3 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Micro 5.4 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Micro 5.4 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Micro 5.4 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Micro 5.5 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Micro 5.5 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Basesystem 15 SP4 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Basesystem 15 SP4 gcc7 0 7.5.0+r278197-150000.4.35.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Development Tools 15 SP4 cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.3.2
SUSE:Linux Enterprise Module for Development Tools 15 SP4 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 gcc12-testresults 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Development Tools 15 SP5 cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Development Tools 15 SP5 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP5 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.3.2
SUSE:Linux Enterprise Module for Development Tools 15 SP5 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Development Tools 15 SP5 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Development Tools 15 SP5 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Legacy 15 SP4 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Package Hub 15 SP4 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Package Hub 15 SP4 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Package Hub 15 SP4 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Package Hub 15 SP5 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Module for Package Hub 15 SP5 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Module for Package Hub 15 SP5 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Linux Enterprise Module for Toolchain 12 cross-nvptx-gcc12 0 12.3.0+git1204-1.13.1
SUSE:Linux Enterprise Module for Toolchain 12 cross-nvptx-gcc13 0 13.2.1+git7813-1.10.1
SUSE:Linux Enterprise Module for Toolchain 12 cross-nvptx-gcc7 0 7.5.0+r278197-13.1
SUSE:Linux Enterprise Module for Toolchain 12 gcc12 0 12.3.0+git1204-1.13.1
SUSE:Linux Enterprise Module for Toolchain 12 gcc13 0 13.2.1+git7813-1.10.1
SUSE:Linux Enterprise Module for Toolchain 12 gcc7 0 7.5.0+r278197-13.1
SUSE:Linux Enterprise Server 12 SP5 gcc12 0 12.3.0+git1204-1.13.1
SUSE:Linux Enterprise Server 12 SP5 gcc13 0 13.2.1+git7813-1.10.1
SUSE:Linux Enterprise Server 12 SP5 gcc7 0 7.5.0+r278197-13.1
SUSE:Linux Enterprise Server 15 SP1-LTSS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server 15 SP1-LTSS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server 15 SP1-LTSS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server 15 SP1-LTSS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server 15 SP2-LTSS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server 15 SP2-LTSS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server 15 SP2-LTSS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server 15 SP2-LTSS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server 15 SP3-LTSS cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server 15 SP3-LTSS cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server 15 SP3-LTSS gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server 15 SP3-LTSS gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 gcc12 0 12.3.0+git1204-1.13.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 gcc13 0 13.2.1+git7813-1.10.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP5 gcc7 0 7.5.0+r278197-13.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 cross-nvptx-gcc7 0 7.5.0+r278197-150000.4.35.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP1 gcc7 0 7.5.0+r278197-150000.4.35.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 cross-nvptx-gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 cross-nvptx-gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 gcc13 0 13.2.1+git7813-150000.1.6.1
SUSE:Manager Proxy 4.2 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Manager Proxy 4.2 gcc13 0 13.2.1+git7813-150000.1.3.3
SUSE:Manager Server 4.2 gcc12 0 12.3.0+git1204-150000.1.16.1
SUSE:Manager Server 4.2 gcc13 0 13.2.1+git7813-150000.1.3.3
Ubuntu:14.04:LTS gcc-4.7 0 No fix
Ubuntu:14.04:LTS gcc-4.8 0 No fix
Ubuntu:14.04:LTS gcc-mingw-w64 0 No fix
Ubuntu:14.04:LTS gccgo-4.9 0 No fix
Ubuntu:16.04:LTS gcc-4.7 0 No fix
Ubuntu:16.04:LTS gcc-4.7-armel-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.7-armhf-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8 0 No fix
Ubuntu:16.04:LTS gcc-4.8-arm64-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8-armhf-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8-powerpc-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.8-ppc64el-cross 0 No fix
Ubuntu:16.04:LTS gcc-4.9 0 No fix
Ubuntu:16.04:LTS gcc-4.9-cross 0 No fix
Ubuntu:16.04:LTS gcc-5-cross 0 No fix
Ubuntu:16.04:LTS gcc-5-cross-ports 0 No fix
Ubuntu:16.04:LTS gcc-arm-linux-androideabi 0 No fix
Ubuntu:16.04:LTS gcc-arm-none-eabi 0 No fix
Ubuntu:16.04:LTS gcc-avr 0 No fix
Ubuntu:16.04:LTS gcc-h8300-hms 0 No fix
Ubuntu:16.04:LTS gcc-i686-linux-android 0 No fix
Ubuntu:16.04:LTS gcc-m68hc1x 0 No fix
Ubuntu:16.04:LTS gcc-mingw-w64 0 No fix
Ubuntu:16.04:LTS gcc-msp430 0 No fix
Ubuntu:16.04:LTS gcc-opt 0 No fix
Ubuntu:16.04:LTS gcc-snapshot 0 No fix
Ubuntu:18.04:LTS gcc-4.8 0 No fix
Ubuntu:18.04:LTS gcc-5 0 No fix
Ubuntu:18.04:LTS gcc-5-cross 0 No fix
Ubuntu:18.04:LTS gcc-5-cross-ports 0 No fix
Ubuntu:18.04:LTS gcc-6 0 No fix
Ubuntu:18.04:LTS gcc-6-cross 0 No fix
Ubuntu:18.04:LTS gcc-6-cross-ports 0 No fix
Ubuntu:18.04:LTS gcc-7 0 No fix
Ubuntu:18.04:LTS gcc-7-cross 0 No fix
Ubuntu:18.04:LTS gcc-7-cross-ports 0 No fix
Ubuntu:18.04:LTS gcc-8 0 No fix
Ubuntu:18.04:LTS gcc-8-cross 0 No fix
Ubuntu:18.04:LTS gcc-8-cross-ports 0 No fix
Ubuntu:18.04:LTS gcc-opt 0 No fix
Ubuntu:18.04:LTS gcc-snapshot 0 No fix
Ubuntu:20.04:LTS gcc-10 0 No fix

Related vulnerabilities