Use-After-Free Vulnerability in libarchive: CVE-2019-18408

libarchive Updated 02 Oct 2025

Summary

24/10/2019
N/A
Yes i
High
7.5

ALPINE-CVE-2019-18408: archive_read_format_rar_read_data in archive_read_support_format_rar.c in libarchive before 3.4.0 has a use-after-free in a certain ARCHIVE_FAILED situation, related to Ppmd7_DecodeSymbol. Affects libarchive versions < 3.3.3-r1. Fixed in 3.3.3-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

libarchive is a widely used library for reading and writing streaming archive formats, including tar, cpio, zip, and rar. It provides a flexible and efficient way to handle various archive formats, making it a crucial component in many software applications. However, a vulnerability has been identified in libarchive that could lead to serious security issues if not addressed.

Vulnerability Detail

The vulnerability, identified as CVE-2019-18408, arises from a use-after-free condition in the function archive_read_format_rar_read_data within the file archive_read_support_format_rar.c. This issue occurs in certain scenarios where the function encounters an ARCHIVE_FAILED situation, specifically related to the Ppmd7_DecodeSymbol function. If exploited, this vulnerability could allow an attacker to execute arbitrary code, potentially compromising the integrity and confidentiality of the affected system. The CVSS score for this vulnerability is 7.5, indicating a high severity level.

How To Fix

Minimum fixed version

3.3.3-r1

This is the first release that contains the fix.

sudo apk add --upgrade libarchive

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid processing RAR files until the library is updated to a secure version. This will mitigate the risk of exploitation until a proper fix is applied.

Conclusion

The CVE-2019-18408 vulnerability in libarchive presents a serious security risk due to a use-after-free condition that can lead to arbitrary code execution. It is crucial for users to update their libarchive package to the latest patched version to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for libarchive →

Share this vulnerability

FAQ

CVE-2019-18408 is a security vulnerability in the libarchive library that allows for a use-after-free condition, which could lead to arbitrary code execution.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2019-18408 is 7.5, indicating a high severity level.

You can update libarchive on Alpine Linux by running 'apk update' followed by 'apk upgrade libarchive' to ensure you have the patched version.

While specific exploits may not be publicly disclosed, the nature of the vulnerability suggests that it could be exploited to execute arbitrary code, posing a significant risk.

Related vulnerabilities

Recent vulnerabilities recorded for libarchive.

How To Fix

Minimum fixed version

3.3.3-r1

This is the first release that contains the fix.

sudo apk add --upgrade libarchive

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback