Bug 2571893 (CVE-2026-126831) - CVE-2026-126831 cpio: cpio: stack-based buffer overflow in write_out_tar_header() with long usernames/groupnames
Summary: CVE-2026-126831 cpio: cpio: stack-based buffer overflow in write_out_tar_head...
Keywords:
Status: NEW
Alias: CVE-2026-126831
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-11-11 21:07 UTC by OSIDB Bzimport
Modified: 2026-11-12 14:52 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.