CVE-2023-39804
Description
In GNU tar before 1.35, mishandled extension attributes in a PAX archive can lead to an application crash in xheader.c.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
16- osv-coords14 versionspkg:rpm/opensuse/tar&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/tar&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/tar&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/tar&distro=openSUSE%20Leap%20Micro%205.4pkg:rpm/opensuse/tar&distro=openSUSE%20Tumbleweedpkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Micro%205.1pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Micro%205.4pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Micro%205.5pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/tar&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5
< 1.34-150000.3.34.1+ 13 more
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.35-2.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.34-150000.3.34.1
- (no CPE)range: < 1.27.1-15.24.1
- (no CPE)range: < 1.27.1-15.24.1
Patches
Vulnerability mechanics
Root cause
"Missing delimiter check in prefix-keyword matching and use of stack-allocated buffers for extended attribute data in PAX header parsing."
Attack vector
An attacker crafts a PAX archive containing an extended header keyword that begins with a registered prefix (such as `SCHILY.xattr.`) but is not followed by a dot. The flawed prefix matching in `locate_handler` [ref_id=1] returns a handler for the wrong keyword, and the subsequent `xattr_decoder` copies oversized data into a stack buffer via `alloca`, causing a crash. The attacker only needs to supply a malicious archive file; no authentication or special network access is required.
Affected code
The crash occurs in `src/xheader.c` in the `locate_handler` function, which mismatches prefix keywords (e.g. `SCHILY.xattr.`) against arbitrary keywords that merely start with the same characters, and in `xattr_decoder`, which uses stack-allocated buffers (`alloca`) that can overflow when processing crafted extended attributes.
What the fix does
The patch [ref_id=1] corrects `locate_handler` to verify that the character following the prefix keyword is a dot (`'.'`) before treating it as a match, preventing false handler selection. In `xattr_decoder`, the stack-allocated buffers (`alloca`) are replaced with heap allocations (`xmalloc`/`xstrdup`) and proper `free` calls, eliminating the stack overflow that caused the crash.
Preconditions
- inputThe attacker must supply a PAX archive with a crafted extended header keyword that starts with a registered prefix but is not followed by a dot.
- configThe victim must attempt to extract or inspect the archive with GNU tar before version 1.35.
Generated on Jun 14, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.