Skip to main content
Vulnerability Database/CVE-2025-14104

CVE-2025-14104: util-linux Buffer Overflow Vulnerability

CVE-2025-14104 is a heap buffer overread flaw in util-linux that occurs when processing 256-byte usernames in the setpwnam() function. This affects SUID login-utils utilities writing to the password database. This article covers technical details, affected versions, security impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-14104 Overview

CVE-2025-14104 is a heap buffer overread vulnerability in the util-linux package. The flaw resides in the setpwnam() function used by SUID (Set User ID) login utilities that write to the system password database. When the function processes a 256-byte username, it reads past the allocated heap buffer boundary. The issue is classified as an out-of-bounds read [CWE-125]. Because the affected utilities run with elevated privileges, a local user supplying a crafted username can trigger memory corruption effects that may disclose adjacent heap data or crash the process.

Critical Impact

A local, low-privileged user can trigger a heap out-of-bounds read in SUID login utilities, potentially causing denial of service or leaking adjacent heap memory contents.

Affected Products

  • util-linux package shipped across Linux distributions
  • Red Hat Enterprise Linux (multiple versions, per RHSA advisories)
  • SUID login utilities invoking setpwnam() (for example, utilities writing to /etc/passwd)

Discovery Timeline

  • 2025-12-05 - CVE-2025-14104 published to NVD
  • 2026-10-18 - Last updated in NVD database

Technical Details for CVE-2025-14104

Vulnerability Analysis

The vulnerability lives in the setpwnam() routine within the util-linux login utilities. The function is responsible for serializing a passwd structure into the password database. When the supplied username reaches the 256-byte boundary, the serialization logic reads beyond the end of the heap buffer backing the username field.

The affected utilities are installed with the SUID bit set, so they execute with root privileges even when invoked by an unprivileged account. This elevates what would otherwise be a minor memory bug into a locally reachable issue in privileged code. Successful triggering produces process termination or disclosure of adjacent heap memory to the controlling user.

Root Cause

The root cause is improper boundary handling when the username length matches an edge-case value of 256 bytes. The code reads one or more bytes past the allocated heap region instead of enforcing a strict length check. This is a classic out-of-bounds read pattern tracked as [CWE-125].

Attack Vector

Exploitation requires local access and low-privileged credentials; no user interaction is needed. An attacker invokes an affected SUID login utility, supplying a 256-byte username that reaches setpwnam(). The overread occurs inside the privileged process, which may crash or expose adjacent heap contents. The vector is strictly local, so remote-only attackers cannot reach the sink without first obtaining shell access.

No verified public proof-of-concept code is available. See the Red Hat CVE-2025-14104 Details and Red Hat Bug Report #2419369 for upstream technical analysis.

Detection Methods for CVE-2025-14104

Indicators of Compromise

  • Unexpected crashes or SIGSEGV signals in SUID login utilities such as those modifying /etc/passwd.
  • Core dumps generated by util-linux binaries containing abnormally long username strings.
  • Audit records showing invocation of SUID login utilities by unprivileged users with usernames approaching 256 bytes.

Detection Strategies

  • Monitor auditd for execve events targeting SUID util-linux binaries with oversized command-line arguments.
  • Correlate kernel segfault messages in dmesg or /var/log/messages with the parent SUID process name.
  • Compare installed util-linux package versions against the fixed releases in the referenced Red Hat Security Advisories.

Monitoring Recommendations

  • Enable process accounting and collect telemetry on all SUID binaries executed by non-root users.
  • Alert on repeated crash events for the same login utility, which may indicate exploitation attempts.
  • Review file integrity monitoring data for unexpected changes to /etc/passwd, /etc/shadow, or /etc/group.

How to Mitigate CVE-2025-14104

Immediate Actions Required

  • Apply the vendor-supplied util-linux update from your Linux distribution as soon as it is available.
  • Inventory systems using rpm -q util-linux or dpkg -l util-linux and prioritize multi-user hosts and shared build servers.
  • Restrict interactive and shell access on affected systems until patches are deployed.

Patch Information

Red Hat has published multiple errata addressing CVE-2025-14104, including RHSA-2026:1696, RHSA-2026:1852, RHSA-2026:1913, RHSA-2026:2485, RHSA-2026:2563, RHSA-2026:2737, RHSA-2026:2800, RHSA-2026:3406, RHSA-2026:4943, and RHSA-2026:7180. Consult your distribution advisory for the exact fixed version.

Workarounds

  • Remove the SUID bit from non-essential util-linux login utilities where feasible (chmod u-s <binary>), understanding that this breaks user-initiated password changes.
  • Enforce username length limits in provisioning workflows so values approaching 256 bytes cannot be submitted to login utilities.
  • Restrict access to affected SUID binaries using filesystem ACLs or Mandatory Access Control policies such as SELinux or AppArmor.
bash
# Verify installed util-linux version and check SUID binaries
rpm -q util-linux
find /usr/bin /usr/sbin -perm -4000 -user root -exec ls -l {} \; | grep -E 'chfn|chsh|newgrp|login'

# Example SELinux check to confirm confinement is active
sestatus

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.