Bug 2571893 (CVE-2026-126831)

Summary: CVE-2026-126831 cpio: cpio: stack-based buffer overflow in write_out_tar_header() with long usernames/groupnames
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: rhel-process-autobot, watson-tool-maintainers
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in cpio. A local user can cause a Denial of Service (DoS) by triggering a stack-based buffer overflow when creating archives in tar or ustar formats. When archiving files owned by users or groups with names exceeding 32 characters, cpio copies these names into fixed-size memory without verifying their length. This unbounded copy corrupts stack memory and causes the application to crash.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description OSIDB Bzimport 2026-11-11 21:07:56 UTC
A flaw was found in GNU cpio through version 2.15. A stack-based buffer overflow exists in src/tar.c:write_out_tar_header() via set_tar_fname().

When generating archives using the ustar or tar formats (e.g., `cpio -o -H ustar`), set_tar_fname() uses unbounded strcpy() calls to copy user and group names obtained from getpwuid() and getgrgid() into the 32-byte fixed-size tar_hdr->uname and tar_hdr->gname fields within struct tar_header on the stack. If a file being archived is owned by a user or group whose name exceeds 32 characters (common in LDAP, Active Directory, or container environments), strcpy() overflows the destination buffer and corrupts adjacent stack variables.