CVE-2021-40400
NixOS vulnerability analysis and mitigation

Overview

An out-of-bounds read vulnerability exists in the RS-274X aperture macro outline primitive functionality of Gerbv 2.7.0 and dev (commit b5f1eacd) and the forked version of Gerbv (commit d7f42a9a). A specially-crafted Gerber file can lead to information disclosure. An attacker can provide a malicious file to trigger this vulnerability (Talos Advisory).

Technical details

The vulnerability exists in the RS-274X aperture macro outline primitive functionality. The issue occurs in the simplify_aperture_macro function where the stack buffer size depends on nuf_push, while the memcpy operation size depends on nuf_parameters. An attacker can set an arbitrary nuf_parameters value from 0 to 102, causing the memcpy to range from 0 to 816 bytes. If nuf_push is smaller than nuf_parameters, this leads to an out-of-bounds read on the s->stack buffer, resulting in data from nearby heap chunks being stored into sam->parameter. The vulnerability has been assigned a CVSS v3.0 score of 9.3 CRITICAL (Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:H) (Talos Advisory).

Impact

The vulnerability could allow an attacker to extract heap metadata or contents by reading the resulting rendered image. Since sam->parameter is used to draw the shape for the macro being evaluated, this will result in the final drawing having a different shape, coordinate points and rotation, depending on the values stored in the nearby heap chunks. The quality of the information leak depends on the DPI chosen for the operation (Talos Advisory).

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