VYPR
High severity8.8NVD Advisory· Published Jun 1, 2026

CVE-2026-43623

CVE-2026-43623

Description

microtar through 0.1.0 contains a stack-based buffer overflow vulnerability in the raw_to_header() function in src/microtar.c that allows attackers to corrupt adjacent stack memory by supplying a crafted TAR archive with non-null-terminated name or linkname fields. The function uses strcpy() to copy 100-byte ustar format fields that lack null terminators, causing writes of up to 355 bytes into a 100-byte destination buffer when mtar_open(), mtar_find(), or mtar_read_header() process attacker-supplied TAR archives.

Affected products

1

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"The raw_to_header function uses strcpy to copy data from fixed-size tar header fields without checking for null terminators, leading to buffer overflows."

Attack vector

An attacker can supply a crafted TAR archive containing a non-null-terminated name or linkname field. When the `mtar_open()`, `mtar_find()`, or `mtar_read_header()` functions process this archive, the `strcpy()` function will read past the 100-byte buffer boundary. This can result in writing up to 355 bytes into a 100-byte destination buffer, corrupting adjacent stack memory and potentially enabling arbitrary code execution [ref_id=1].

Affected code

The vulnerability resides in the `raw_to_header()` function within `src/microtar.c`. Specifically, lines 111-112, which contain `strcpy(h->name, rh->name);` and `strcpy(h->linkname, rh->linkname);`, are responsible for copying data from the raw header to the parsed header structure without proper bounds checking [ref_id=1, ref_id=2, ref_id=3].

What the fix does

The suggested fix replaces the vulnerable `strcpy()` calls with `memcpy()` operations that copy a fixed number of bytes (99 or 100) and then explicitly null-terminate the destination buffer. This prevents `strcpy()` from reading past the end of the source field and writing beyond the bounds of the destination buffer, thus mitigating the stack-based buffer overflow vulnerability [ref_id=1, ref_id=2, ref_id=3].

Preconditions

  • inputThe system must process a TAR archive supplied by an attacker.

Reproduction

# Compile with ASAN clang -g -O1 -fsanitize=address,undefined -fno-sanitize=function -I microtar/src -o microtar_asan driver.c microtar/src/microtar.c

# Run with PoC ./microtar_asan linkname_overflow.tar # -> ASAN crash: stack-buffer-overflow

Generated on Jun 1, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.