Skip to content

rclone archive extract allows S3 destination prefix escape via crafted archive paths

Moderate severity GitHub Reviewed Published Jul 8, 2026 in rclone/rclone • Updated Aug 5, 2026

Package

gomod github.com/rclone/rclone (Go)

Affected versions

<= 1.74.3

Patched versions

1.74.4

Description

Summary

rclone archive extract can write extracted files outside the user-selected destination prefix when extracting a crafted archive. A malicious archive entry containing parent path components such as ../ can escape the requested extraction prefix and create or overwrite sibling objects in the same bucket/path scope.

Details

The affected code path is in cmd/archive/extract/extract.go.

In ArchiveExtract(), the archive entry path is taken from f.NameInArchive. The code strips only a leading ./ prefix and then joins the archive entry path with the destination directory:

remote := f.NameInArchive
remote = strings.TrimPrefix(remote, "./")
if dstDir != "" {
    remote = path.Join(dstDir, remote)
}
_, err = operations.Rcat(ctx, dst, remote, fin, f.ModTime(), nil)

Parent path components such as ../ are not rejected before path.Join() is used.

When the destination is an S3-style remote such as:

:s3:bucket/safe/prefix

rclone creates the destination filesystem rooted at bucket/safe and treats prefix as the destination directory. If the archive contains an entry named:

../escaped-from-prefix.txt

then path.Join("prefix", "../escaped-from-prefix.txt") resolves to:

escaped-from-prefix.txt

As a result, the S3 backend uploads the object to:

bucket/safe/escaped-from-prefix.txt

instead of the expected destination:

bucket/safe/prefix/escaped-from-prefix.txt

This allows an attacker-controlled archive to escape the selected extraction prefix on object-storage remotes.

PoC

Test environment:

  • Windows 11
  • rclone v1.74.3 official Windows amd64 binary
  • Local fake S3 HTTP endpoint
  • Crafted ZIP archive containing ../escaped-from-prefix.txt

Steps to reproduce:https://drive.google.com/file/d/1P_cLKFgiWSVSATB8500yP28jdzwt9FAt/view?usp=sharing

  1. Extract the attached PoC ZIP.

  2. Run the PoC script:

powershell -ExecutionPolicy Bypass -File .\run-poc.ps1 -RcloneExe "C:\path\to\rclone.exe"
  1. The PoC creates a ZIP archive containing this entry:
../escaped-from-prefix.txt
  1. The PoC starts a local fake S3 endpoint and runs rclone with an S3-style destination prefix:
rclone archive extract malicious.zip :s3:bucket/safe/prefix
  1. Observe the fake S3 request log.

Expected safe behavior:

PUT /bucket/safe/prefix/escaped-from-prefix.txt

Observed behavior:

PUT /bucket/safe/escaped-from-prefix.txt?x-id=PutObject

This shows that the archive entry escaped the requested safe/prefix destination and was written under safe/ instead.

The PoC package includes:

  • run-poc.ps1
  • fake-s3-server.py
  • README.md
  • report-draft.md
  • captured proof logs

Impact

An attacker who supplies an archive that a victim extracts with rclone archive extract can cause extracted files to be written outside the destination prefix selected by the victim when the destination is an S3-style object storage remote.

Depending on the victim's configured remote credentials and bucket permissions, this may allow creation or overwrite of sibling objects outside the intended extraction directory/prefix.

This does not require compromising the S3 service itself. The attack relies on the victim extracting an attacker-controlled archive with rclone into an object-storage prefix.

References

@ncw ncw published to rclone/rclone Jul 8, 2026
Published by the National Vulnerability Database Jul 14, 2026
Published to the GitHub Advisory Database Aug 5, 2026
Reviewed Aug 5, 2026
Last updated Aug 5, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
None
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(12th percentile)

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

CVE ID

CVE-2026-59732

GHSA ID

GHSA-4vr5-p2gc-h23p

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.