CVE-2018-25046: Cloud Foundry Archiver Path Traversal Vulnerability

Summary

28/12/2022
Yes i
Critical
9.1

CVE-2018-25046: Cloud Foundry Archiver vulnerable to path traversal. Affects github.com/cloudfoundry/archiver versions < 0.0.0-20180523222229-09b5706aa936. Fixed in 0.0.0-20180523222229-09b5706aa936. How to fix ↓

Also tracked for

The same CVE-2018-25046 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Cloud Foundry Archiver is a Go package that provides functionality for archiving and compressing files. It is commonly used in Cloud Foundry deployments to package and distribute applications. The package is vulnerable to a path traversal attack due to improper path sanitization. This vulnerability allows an attacker to include relative file paths in an archive, which can result in files being written or overwritten outside of the intended target directory.

Vulnerability Detail

The vulnerability arises from the lack of proper validation and sanitization of file paths within the Cloud Foundry Archiver package. When processing archives, the package fails to adequately prevent the inclusion of relative file paths. As a result, an attacker can craft a malicious archive that includes file paths that traverse outside of the intended target directory. This can lead to unauthorized access, modification, or deletion of files on the system. The impact of this vulnerability can be severe, as it allows an attacker to manipulate files and potentially compromise the integrity and security of the system.

How To Fix

Latest published version: v0.0.0-20200131002800-4ca7245c29b1 as of 22 Oct 2026

go get github.com/cloudfoundry/archiver@v0.0.0-20200131002800-4ca7245c29b1

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

If you need the minimum change

0.0.0-20180523222229-09b5706aa936

This is the first release that contains the fix.

go get github.com/cloudfoundry/archiver@v0.0.0-20180523222229-09b5706aa936

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

Workaround

As a workaround, developers can implement their own path sanitization logic when processing archives. This can involve validating and normalizing file paths to ensure they are within the intended target directory and do not allow traversal outside of it. Here is an example of how this can be done in Go:

import (
    "path/filepath"
)

func sanitizePath(path string) (string, error) {
    absPath, err := filepath.Abs(path)
    if err != nil {
        return "", err
    }
    // Check if the absolute path is within the target directory
    if !strings.HasPrefix(absPath, "/path/to/target/directory") {
        return "", errors.New("Invalid file path")
    }
    return absPath, nil
}

Conclusion

The Cloud Foundry Archiver package is vulnerable to a path traversal attack due to improper path sanitization. This vulnerability can be exploited to manipulate files and compromise the integrity and security of the system. It is crucial to update to a fixed version of the package and implement proper path sanitization logic when processing archives. For additional support and guidance, contact DevNack.com.

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

Share this vulnerability

FAQ

This vulnerability allows an attacker to manipulate files and potentially compromise the integrity and security of the system. They can read, modify, or delete files outside of the intended target directory.

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 only the Gopkg.lock file.

Yes, the vulnerability has been fixed in version 0.0.0-20180523222229-09b5706aa936 of the Cloud Foundry Archiver package. It is recommended to update to this version or a later one to mitigate the vulnerability.

Yes, developers can implement their own path sanitization logic when processing archives to prevent path traversal. The provided workaround code snippet demonstrates how this can be done in Go.

For further support on vulnerability remediation, you can contact info@devnack.com. They can provide assistance and guidance in addressing this vulnerability.

How To Fix

Latest published version: v0.0.0-20200131002800-4ca7245c29b1 as of 22 Oct 2026

go get github.com/cloudfoundry/archiver@v0.0.0-20200131002800-4ca7245c29b1

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

If you need the minimum change

0.0.0-20180523222229-09b5706aa936

This is the first release that contains the fix.

go get github.com/cloudfoundry/archiver@v0.0.0-20180523222229-09b5706aa936

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