CVE-2022-3821
NixOS vulnerability analysis and mitigation

Overview

An off-by-one error vulnerability was discovered in systemd's format_timespan() function of time-util.c (CVE-2022-3821). The vulnerability was reported on July 7, 2022, and affects systemd versions prior to 251.3. The issue allows an attacker to supply specific values for time and accuracy parameters that lead to a buffer overrun (NVD, Ubuntu).

Technical details

The vulnerability exists in the formattimespan() function where n = MIN((sizet) k, l) can assign the buffer size l to n. Subsequently, p += n causes p to point to one byte after the buffer buf, leading to a buffer overwrite in *p=0. This represents an off-by-one error that could be triggered by providing specific time and accuracy values (GitHub Issue). The vulnerability has a CVSS v3.1 Base Score of 5.5 (Medium) with attack vector being Local, attack complexity Low, and privileges required Low (Ubuntu).

Impact

The successful exploitation of this vulnerability can lead to a Denial of Service (DoS) condition. When specific values for time and accuracy are supplied to the format_timespan() function, it results in a buffer overrun that could potentially crash the system (NVD).

Mitigation and workarounds

The vulnerability was fixed in systemd version 251.3 through a patch that corrects the buffer handling in the formattimespan() function. The fix was implemented by changing n = MIN((sizet) k, l) to n = MIN((size_t) k, l-1) (GitHub PR). Users are advised to upgrade their systemd packages to version 251.3 or later to address this vulnerability (Gentoo).

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-2025-48606HIGH7.8
  • NixOSNixOS
  • android
NoNoDec 08, 2025
CVE-2025-48639HIGH7.3
  • NixOSNixOS
  • android
NoNoDec 08, 2025
CVE-2025-48625HIGH7
  • NixOSNixOS
  • android
NoNoDec 08, 2025
CVE-2025-48608MEDIUM5.5
  • NixOSNixOS
  • android
NoNoDec 08, 2025
CVE-2025-48569MEDIUM5.5
  • NixOSNixOS
  • android
NoNoDec 08, 2025

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