CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-W8J7-39HP-8X59

GHSA-W8J7-39HP-8X59: Path Traversal Vulnerability in Cloudreve Remote Downloader Workflow

Alon Barad
Alon Barad
Software Engineer

Aug 25, 2026·7 min read·7 visits

Executive Summary (TL;DR)

Authenticated users can write files outside target directories by exploiting missing path-traversal validation in Cloudreve's integration with remote downloaders like aria2.

A path traversal vulnerability exists in Cloudreve's remote download workflow, where improper sanitization of file paths returned by configured remote downloaders (such as aria2) allows authenticated users to write files outside the designated target folder.

Vulnerability Overview

Cloudreve is an open-source, multi-protocol file management system implemented in Go, which allows users to aggregate multiple storage strategies under a unified interface. A critical component of Cloudreve is its remote download workflow, which integrates with external downloaders like aria2. This integration relies on communication via JSON-RPC to monitor download states and retrieve metadata about completed transfers.

The remote download workflow exposes an attack surface where Cloudreve processes file paths returned directly by the external downloader daemon. The application relies on a validation function, sanitizeFileName, to ensure that filenames received from external systems do not contain dangerous sequences. However, because this function only filters system-specific characters such as colons and backslashes, it fails to neutralize directory traversal structures.

This validation deficiency leads to CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-23 (Relative Path Traversal). The impact is limited to users with permissions to configure or execute remote downloads, but it allows for arbitrary file write placement within the virtual URI namespace. This can bypass directory-level boundaries, access control lists, and user-configured storage quota restrictions.

Root Cause Analysis

The vulnerability originates in pkg/filemanager/workflows/remote_download.go within the sanitizeFileName function. This function uses Go's strings.NewReplacer to replace invalid characters like backslashes, colons, asterisks, and quotes with underscores. However, it completely omits forward slashes (/) and dots (.), which are the primary building blocks of path traversal strings in Unix-like environments.

When a remote download task completes, Cloudreve queries the downloader daemon using RPC methods to fetch the status of the files. The file metadata returned contains the local path where the downloader saved the file. Cloudreve extracts the filename by trimming the configured download save path from this string. The resulting relative path is then passed directly to sanitizeFileName and subsequently processed.

Because sanitizeFileName leaves traversal sequences untouched, a path containing ../../escaped.txt remains unchanged. The application then passes this string to the URI-joining component of its internal file system implementation. This processing chain allows the untrusted relative path to influence the final physical or virtual storage location.

The resolution of these relative segments occurs inside JoinRaw, which splits the input string by path separators and sequentially applies the directory movements to the base URI. When encountering the .. elements, the URI resolver moves up the directory tree past the intended sandbox base directory. This is the logical core of the vulnerability, where trusted virtual namespace paths are programmatically overridden by the untrusted downloader input.

Code Analysis

To understand the vulnerable code path, we must inspect the sanitizeFileName implementation and its application during target path resolution. The following code block shows the vulnerable sanitizer and the two vulnerable assembly points in pkg/filemanager/workflows/remote_download.go:

// Vulnerable sanitizer in pkg/filemanager/workflows/remote_download.go
func sanitizeFileName(name string) string {
    // This replacer lacks rules for forward slashes (/) and dots (.)
    r := strings.NewReplacer("\\", "_", ":", "_", "*", "_", "?", "_", "\"", "_", "<", "_", ">", "_", "|", "_")
    return r.Replace(name)
}

During the download completion process, the master node retrieves the file.Name value from the downloader driver's response payload. It processes this value using the vulnerable sanitizer and then appends it to the destination URI using the vulnerable JoinRaw method:

// Insecure assembly on Master Node (remote_download.go)
sanitizedName := sanitizeFileName(file.Name) // Returns "../../escaped.txt"
dst := dstUri.JoinRaw(sanitizedName)         // Resolves outside the base directory
src := filepath.FromSlash(path.Join(m.state.Status.SavePath, file.Name))

Similarly, slave nodes that process remote downloads construct the transfer entities using the same insecure pattern. They register the uploaded entities with the resolved destination paths, allowing files to bypass target storage directories during clustered node synchronization:

// Insecure assembly on Slave Node (remote_download.go)
dst := dstUri.JoinRaw(sanitizeFileName(f.Name)) // Insecure resolution
src := path.Join(m.state.Status.SavePath, f.Name)
payload.Files = append(payload.Files, SlaveUploadEntity{
    Src:   src,
    Uri:   dst,
})

The JoinRaw function in pkg/filemanager/fs/uri.go splits the argument and routes the individual directory steps directly to the URI's Join method. Because Join resolves parent directories incrementally when it encounters .., the structure is walked back beyond the root of the targeted folder, resulting in out-of-bounds file placement.

Exploitation Methodology

Exploitation of this vulnerability requires that an attacker have the privileges necessary to schedule remote download tasks in Cloudreve. This configuration is typically restricted to authenticated users or administrators, depending on the system's access control policy. An attacker can execute the exploit using one of two primary attack vectors.

The first vector involves configuring Cloudreve's remote download agent to point to a malicious JSON-RPC server hosted on an attacker-controlled endpoint. When Cloudreve queries this server for download status updates, the server returns manipulated file paths containing relative traversal sequences. The backend blindly trusts the response and places the files in the traversed path.

The second vector is more direct and does not require modifying the RPC endpoint. An attacker can upload a multi-file torrent or metafile download task where the torrent internal file structure contains relative paths (e.g., ../../escaped.txt). If the legitimate aria2 daemon downloads this torrent, it reports the internal relative file paths back to Cloudreve, which processes them using the vulnerable sanitizeFileName routine.

The expected outcome of successful exploitation is the placement of download payloads into arbitrary directories within the Cloudreve storage provider workspace. While this does not automatically grant operating system-level arbitrary code execution, it allows an attacker to bypass file access boundaries, write malicious scripts into web-accessible folders, or overwrite other users' files within the virtual URI namespace.

Impact Assessment

This vulnerability has been assigned a CVSS v4.0 score of 5.5 (Medium Severity). The vulnerability's attack vector is Network, and it requires low complexity and no user interaction from other victims. However, it does require authenticated privileges to initiate download tasks, which dampens the severity rating compared to unauthenticated remote code execution bugs.

The primary impact of the flaw is a loss of integrity. An attacker can write files to arbitrary locations in the Cloudreve virtual file system. In multi-user setups, this allows a tenant to write files to folders owned by other users or administrators, exposing private storage spaces to unauthorized additions.

Depending on the configured storage backend, the traversal can have additional side effects. If Cloudreve is configured with local file storage and virtual paths reflect direct disk directories, path traversal could allow writing files to arbitrary paths on the host filesystem. This scenario elevates the severity to potential remote code execution if the attacker can overwrite executable binaries or configuration files.

At the time of this analysis, there are no records of active exploitation in the wild, and the vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog. The exploit maturity is classified as Proof of Concept, as the technical mechanics are well-documented but require specific environmental conditions to achieve significant malicious impact.

Remediation and Fix Completeness

To mitigate this vulnerability, users must restrict remote download scheduling permissions to highly trusted accounts. If possible, disable external downloader integrations (such as aria2) until a robust validation patch is applied to the Cloudreve codebase. Additionally, restrict network access to the aria2 JSON-RPC endpoint to prevent unauthorized configuration modifications.

A complete programmatic fix requires modifying sanitizeFileName in pkg/filemanager/workflows/remote_download.go. The function should be updated to strip path traversal sequences using standard Go library methods like filepath.Clean and strings.ReplaceAll to remove relative directory shifts:

func sanitizeFileName(name string) string {
    r := strings.NewReplacer("\\", "_", ":", "_", "*", "_", "?", "_", "\"", "_", "<", "_", ">", "_", "|", "_")
    name = r.Replace(name)
    name = filepath.Clean(name)
    name = strings.TrimPrefix(name, "..")
    name = strings.ReplaceAll(name, "..", "")
    name = strings.TrimPrefix(name, "/")
    return name
}

Furthermore, the URI-joining workflow must perform boundary checks. When joining a base URI with user-supplied relative path fragments, the application must verify that the resulting URI retains the original base URI as its prefix. If the resolved path escapes the parent directory, the application must abort the operation and return an access violation error.

func SafeJoinRaw(baseUri *URI, elem string) (*URI, error) {
    sanitized := sanitizeFileName(elem)
    dst := baseUri.JoinRaw(sanitized)
    if !strings.HasPrefix(dst.String(), baseUri.String()) {
        return nil, errors.New("path traversal attempt detected")
    }
    return dst, nil
}

Technical Appendix

CVSS Score
5.5/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P

Affected Systems

Cloudreve

Affected Versions Detail

Product
Affected Versions
Fixed Version
Cloudreve
Cloudreve
<= 4.0.0-20260606032813-26b6b1044b02None
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork
CVSS v4.05.5
Exploit StatusPoC Available
ImpactPartial Integrity (Unintended File Placement)
Privileges RequiredAuthenticated User

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1222File and Directory Permissions Modification
Defense Evasion
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as '..' that can resolve to a location outside of the restricted directory.

Known Exploits & Detection

GitHub Security AdvisoryPython mockup representing the malicious aria2 RPC server demonstrating the traversal sequence injection.

Vulnerability Timeline

Vulnerable code state introduced in early builds
2026-06-06
GitHub Security Advisory GHSA-W8J7-39HP-8X59 published
2026-08-24

References & Sources

  • [1]GitHub Security Advisory Details
  • [2]Cloudreve Security Advisory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•37 minutes ago•CVE-2026-126297
7.5

CVE-2026-126297: Algorithmic Complexity Denial of Service in NLTK ConllCorpusReader

CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).

Amit Schendel
Amit Schendel
1 views•12 min read
•about 2 hours ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
3 views•12 min read
•about 3 hours ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
4 views•10 min read
•about 4 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 5 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 6 hours ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
5 views•10 min read