Home / mailingsPDF  

FreeBSD Security Advisory FreeBSD-SA-25:07.libarchive

Posted on 08 August 2025
FreeBSD security notificat

=============================================================================FreeBSD-SA-25:07.libarchive Security Advisory
The FreeBSD Project

Topic: Integer overflow in libarchive leading to double free

Category: contrib
Module: libarchive
Announced: 2025-08-08
Affects: All supported versions of FreeBSD.
Corrected: 2025-06-19 22:47:34 UTC (stable/14, 14.3-STABLE)
2025-08-08 00:39:05 UTC (releng/14.3, 14.3-RELEASE-p2)
2025-08-08 00:39:19 UTC (releng/14.2, 14.2-RELEASE-p5)
2025-06-20 20:43:32 UTC (stable/13, 13.5-STABLE)
2025-08-08 00:39:29 UTC (releng/13.5, 13.5-RELEASE-p3)
CVE Name: CVE-2025-5914

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:https://security.FreeBSD.org/>.

I. Background

The libarchive(3) library provides a flexible interface for reading and
writing streaming archive files such as tar(1) and cpio(1), and has been the
basis for the FreeBSD implementation of the tar(1) and cpio(1) utilities
since FreeBSD 5.3.

II. Problem Description

An integer overflow in the archive_read_format_rar_seek_data() function may
lead to a double free problem.

III. Impact

Exploiting a double free vulnerability can cause memory corruption. This in
turn could enable a threat actor to execute arbitrary code. It might also
result in denial of service.

IV. Workaround

No workaround is available.

V. Solution

Upgrade your vulnerable system to a supported FreeBSD stable or
release / security branch (releng) dated after the correction date.

Perform one of the following:

1) To update your vulnerable system via a binary patch:

Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms,
or the i386 platform on FreeBSD 13, can be updated via the freebsd-update(8)
utility:

# freebsd-update fetch
# freebsd-update install

2) To update your vulnerable system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

# fetch https://security.FreeBSD.org/patches/SA-25:07/libarchive.patch
# fetch https://security.FreeBSD.org/patches/SA-25:07/libarchive.patch.asc
# gpg --verify libarchive.patch.asc

b) Apply the patch. Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile the operating system using buildworld and installworld as
described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>.

Restart all daemons that use the library, or reboot the system.

VI. Correction details

This issue is corrected as of the corresponding Git commit hash in the
following stable and release branches:

Branch/path Hash Revision
- -------------------------------------------------------------------------
stable/14/ 6dad4525a291 stable/14-n271728
releng/14.3/ fb780a82dfbd releng/14.3-n271438
releng/14.2/ c0979bd2734f releng/14.2-n269532
stable/13/ f47afeb2ce1e stable/13-n259312
releng/13.5/ 798b7b161a71 releng/13.5-n259173
- -------------------------------------------------------------------------

Run the following command to see which files were modified by a
particular commit:

# git show --stat <commit hash>

Or visit the following URL, replacing NNNNNN with the hash:

<URL:https://cgit.freebsd.org/src/commit/?id=NNNNNN>

To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:

# git rev-list --count --first-parent HEAD

VII. References

<URL:https://github.com/libarchive/libarchive/pull/2598>
<URL:https://github.com/advisories/GHSA-7376-x4rm-3v8x>
<URL:https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-5914>

The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-SA-25:07.libarchive.asc>

 

TOP