VYPR
Unrated severityNVD Advisory· Published Mar 27, 2024· Updated Nov 4, 2025

CVE-2023-39804

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

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

3

News mentions

0

No linked articles in our index yet.