CVE-2019-10743: Path Traversal in MHolt Archiver

github.com/mholt/archiver Updated 02 Oct 2025

Summary

18/05/2021
Yes i
Moderate
5.5

CVE-2019-10743: Path Traversal in MHolt Archiver. Affects github.com/mholt/archiver versions >= 3.0.0, < 3.3.2. Fixed in 3.3.2. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

MHolt Archiver is a Go package that provides functionality for creating and extracting various archive formats. It is commonly used for compressing and decompressing files in applications. The vulnerability identified as CVE-2019-10743 affects all versions of archiver and allows an attacker to perform a Zip Slip attack. This attack takes advantage of the 'unarchive' functions in archiver by exploiting specially crafted zip archives that contain path traversal filenames. By manipulating the filenames, an attacker can break out of the target extraction directory and potentially overwrite important files, leading to arbitrary code execution.

Vulnerability Detail

The vulnerability arises from the improper handling of filenames in zip archives. When a malicious archive is processed, the filename is concatenated to the target extraction directory without proper validation. This allows an attacker to include '../' sequences in the filename, which results in traversing outside of the intended directory structure. If an executable or a configuration file is overwritten with a file containing malicious code, the vulnerability can lead to arbitrary code execution. The severity of this vulnerability is rated as MODERATE with a CVSS score of 5.5.

How To Fix

Latest published version: v3.1.1+incompatible as of 23 Oct 2026

go get github.com/mholt/archiver@v3.1.1+incompatible

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.3.2

This is the first release that contains the fix.

go get github.com/mholt/archiver@v3.3.2

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

Workaround

If updating the archiver package is not immediately possible, a temporary workaround is to implement additional validation and sanitization of filenames during the extraction process. This can be done by checking for any '../' sequences and rejecting such filenames. Here is an example code snippet in Go that demonstrates the workaround:

func extractArchive(archivePath string, targetDir string) error {
  // Open the archive
  archive, err := archiver.ByExtension(archivePath)
  if err != nil {
    return err
  }

  // Iterate over the files in the archive
  for _, file := range archive.Files() {
    // Check for path traversal filenames
    if strings.Contains(file.Name(), "../") {
      return errors.New("Invalid filename")
    }

    // Extract the file
    err := archive.Extract(file, targetDir)
    if err != nil {
      return err
    }
  }

  return nil
}

Conclusion

In conclusion, the CVE-2019-10743 vulnerability in MHolt Archiver allows for a path traversal attack through specially crafted zip archives. It is important to update to version 3.3.2 or later of the archiver package to mitigate this vulnerability. If immediate updating is not possible, implementing additional validation and sanitization of filenames can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/mholt/archiver →

Share this vulnerability

FAQ

The vulnerability allows an attacker to break out of the target extraction directory and potentially overwrite important files. This can lead to arbitrary code execution if an executable or a configuration file is replaced with a malicious file.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using Gopkg.lock to analyze the software without requiring access to the code or installation.

Yes, updating to version 3.3.2 or later of the archiver package fixes this vulnerability. The latest version includes proper validation and sanitization of filenames during the extraction process.

If updating the archiver package is not immediately possible, you can implement additional validation and sanitization of filenames during the extraction process. This involves checking for any '../' sequences in filenames and rejecting them.

The severity of this vulnerability is rated as MODERATE with a CVSS score of 5.5.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/mholt/archiver.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: v3.1.1+incompatible as of 23 Oct 2026

go get github.com/mholt/archiver@v3.1.1+incompatible

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.3.2

This is the first release that contains the fix.

go get github.com/mholt/archiver@v3.3.2

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