CVE-2025-5917: Libarchive: off by one error in build_ustar_entry_name() at archive_write_set_format_pax.c
A vulnerability has been identified in the libarchive library. This flaw involves an 'off-by-one' miscalculation when handling prefixes and suffixes for file names. This can lead to a 1-byte write overflow. While seemingly small, such an overflow can corrupt adjacent memory, leading to unpredictable program behavior, crashes, or in specific circumstances, could be leveraged as a building block for more sophisticated exploitation. This bug affects libarchive versions prior to 3.8.0.
Other sources
In libarchive before 3.8.0, an off by one miscalculation of prefixes and suffixes for file names may lead to a 1 byte write overflow.
— Red Hat
Libarchive: off by one error in buildustarentryname() at archivewritesetformatpax.c
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.6.1-7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.7.7-3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.30.3-8 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.21.4-20 - Upgrade
Upgrade
libarchiveto a version that resolves this vulnerability.Fixed in 3.8.0
Event History
Frequently Asked Questions
What is the severity of CVE-2025-5917?
CVE-2025-5917 has been classified with a medium severity level due to the potential for memory corruption.
How do I fix CVE-2025-5917?
To fix CVE-2025-5917, update the libarchive library to the latest version that contains the patch for this vulnerability.
What impact does CVE-2025-5917 have on affected systems?
CVE-2025-5917 can lead to a 1-byte write overflow, which may result in memory corruption and unpredictable application behavior.
Which systems are affected by CVE-2025-5917?
CVE-2025-5917 affects systems that utilize the libarchive library for handling file archives.
Is CVE-2025-5917 easy to exploit?
Exploitation of CVE-2025-5917 may require an attacker to manipulate file names, making it potentially easy to exploit in certain environments.