Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2021-31872
NixOS vulnerability analysis and mitigation

Overview

An issue was discovered in klibc before version 2.0.9, identified as CVE-2021-31872. The vulnerability involves multiple possible integer overflows in the cpio command specifically on 32-bit systems, which may result in a buffer overflow or other security impacts. The vulnerability was discovered and disclosed in April 2021, affecting klibc installations on 32-bit systems (NVD, CVE).

Technical details

The vulnerability stems from the handling of file sizes in the "new" header format of cpio command. The maximum name and file sizes in this format are 32-bit unsigned values, but the I/O functions mostly use long for sizes and offsets, causing sizes >= 2^31 to be handled incorrectly on 32-bit systems. The vulnerability has been assigned a CVSS v3.1 base score of 9.8 (CRITICAL) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD, Kernel Commit).

Impact

The vulnerability could potentially lead to buffer overflow conditions, which might result in arbitrary code execution, system crashes, or other security impacts. The issue is particularly significant for 32-bit systems where integer overflow conditions could be exploited (NVD, Debian LTS).

Exploitability

The vulnerability requires the exploitation of integer overflow conditions in the cpio command on 32-bit systems. While specific exploit details are not publicly documented, the vulnerability could be triggered when processing file names or sizes that exceed certain thresholds in the cpio command (Kernel Commit).

Mitigation and workarounds

The vulnerability was fixed in klibc version 2.0.9. The fix involves adding checks to fail if c_namesize or c_filesize is > LONG_MAX in the read_in_new_ascii() function. Various distributions have released security updates to address this vulnerability, including Debian and Ubuntu. Users are advised to upgrade to klibc version 2.0.9 or later (Klibc Release, Kernel Commit).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Alpine

Fixed

edge

klibc: 2.0.9-r0

Fixed

v3.19

klibc: 2.0.9-r0

Fixed

v3.20

klibc: 2.0.9-r0

Fixed

v3.21

klibc: 2.0.9-r0

Fixed

v3.22

klibc: 2.0.9-r0

Fixed

v3.23

klibc: 2.0.9-r0

Fixed

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-91782LOW1.9
  • NixOS logoNixOS
  • gcc10-binutils
NoYesSep 15, 2026
CVE-2026-91781LOW1.9
  • NixOS logoNixOS
  • binutils
NoYesSep 15, 2026
CVE-2026-91780LOW1.9
  • NixOS logoNixOS
  • binutils
NoNoSep 15, 2026
CVE-2026-91779LOW1.9
  • NixOS logoNixOS
  • binutils
NoNoSep 15, 2026
CVE-2026-90831LOW1.9
  • NixOS logoNixOS
  • gcc-toolset-16-binutils.src
NoYesSep 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