CVE-2023-4039
NixOS vulnerability analysis and mitigation

Overview

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 without detection. This vulnerability (CVE-2023-4039) specifically affects C99-style dynamically-sized local variables or those created using alloca(), while the stack-protector operates as intended for statically-sized local variables. The issue was discovered and disclosed on September 12, 2023, affecting all versions of GCC targeting AArch64 architecture (ARM Security, Meta Security).

Technical details

The vulnerability occurs because GCC's AArch64 backend implements an unconventional stack frame layout where the return address is saved near the bottom of the frame, below the local variables, rather than at the top. The stack guard is placed at the top of the local area, but dynamic allocations reside at the bottom of the stack frame, below the saved registers, with no intervening guard. This architectural design flaw means that buffer overflows in dynamically allocated variables can bypass the stack protection mechanism entirely. The vulnerability has been assigned a CVSS v3.1 base score of 4.8 (Medium) with vector AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N (NVD).

Impact

When the stack-protector detects an overflow, the default behavior is to terminate the application, resulting in a controlled loss of availability. However, due to this vulnerability, an attacker who can exploit a buffer overflow without triggering the stack-protector might be able to change program flow control, potentially causing an uncontrolled loss of availability or affecting confidentiality and integrity of the system (Meta Security).

Mitigation and workarounds

A fix has been made available on GCC's mailing list. Organizations that distribute GCC or ARM64 binaries compiled with GCC are recommended to incorporate this fix. Note that the GCC project argues this is a missed hardening bug rather than a vulnerability by itself (NVD, Meta Security).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22783HIGH8.1
  • NixOSNixOS
  • iris
NoYesJan 12, 2026
CVE-2026-0821MEDIUM6.9
  • NixOSNixOS
  • quickjs
NoNoJan 10, 2026
CVE-2025-68949MEDIUM5.3
  • NixOSNixOS
  • n8n
NoYesJan 13, 2026
CVE-2026-22784LOW2.3
  • NixOSNixOS
  • lychee
NoYesJan 12, 2026
CVE-2026-23497LOW1.3
  • NixOSNixOS
  • learning
NoYesJan 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management