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



CVE-2026-77633

CVE-2026-77633: Storage-quota Time-of-Check to Time-of-Use (TOCTOU) Race Condition in Cloudreve

Alon Barad
Alon Barad
Software Engineer

Sep 23, 2026·7 min read·28 visits

Executive Summary (TL;DR)

A TOCTOU race condition in Cloudreve allows authenticated users to bypass their storage quota limits via concurrent upload sessions, causing host disk exhaustion.

Cloudreve before version 4.18.0 contains a Time-of-Check to Time-of-Use (TOCTOU) race condition in its storage-quota verification logic. Authenticated attackers with basic write access can trigger multiple parallel upload sessions to bypass their storage limits, leading to host disk space exhaustion and Denial of Service.

Vulnerability Overview

Cloudreve is an open-source, self-hosted file management and sharing system that provides multi-user storage orchestration. In configurations utilizing local storage policies, Cloudreve monitors and enforces storage quotas on a per-user basis to prevent storage resource exhaustion. This restriction is managed inside the database and verified during the file upload initialization sequence.

Prior to version 4.18.0, the validation of a user's storage quota and the actual update of that quota were split into disjoint, non-atomic database operations. This architecture exposes a classic Time-of-Check to Time-of-Use (TOCTOU) race condition in the PrepareUpload handler located in pkg/filemanager/fs/dbfs/upload.go. An authenticated attacker with basic write privileges (Files.Write) can exploit this timing window to bypass assigned storage quotas.

By executing parallel upload requests, an attacker can trick the server into authorizing concurrent sessions that collectively exceed the account's allocation limits. The resulting unauthorized sessions allow the physical allocation of massive files to disk, ultimately resulting in server-wide disk space exhaustion and a total Denial of Service (DoS) for all tenants on the affected system.

Root Cause Analysis

The vulnerability stems from an unsynchronized read-then-write pattern on the user capacity record during upload initialization. When a user prepares an upload, Cloudreve first executes f.validateUserCapacity to read the current state of the user's storage limit from the database or an in-memory cache. This value is compared against the maximum allowed threshold, and if the requested file size fits within the remaining space, the application proceeds to initialize the transaction.

Because no database row lock is acquired during this validation phase, multiple concurrent threads can evaluate the same capacity snapshot simultaneously. If an attacker initiates multiple concurrent upload sessions before the database records are updated, each individual thread observes a stale representation of the user's remaining storage capacity. Each thread determines that the user has sufficient quota, and thus all threads approve the request.

Once the validation checks pass, Cloudreve commits the file placeholders and subsequently executes the storage allocation write via CommitWithStorageDiff. Because this charge occurs unconditionally and outside of the transaction that validates the quota, the system registers the total size of all parallel uploads. This design allows the final committed storage value to significantly exceed the user's hard limit, breaking the storage security policy.

Code-Level Analysis

The fundamental code flaw existed in pkg/filemanager/fs/dbfs/upload.go within the PrepareUpload function. The original code queried the user capacity object, checked it, and then opened a transaction to insert the file metadata without securing an exclusive database-level lock on the user's row. The allocation update occurred downstream, completely decoupled from the check.

To remediate this issue, the patch introduces an atomic, database-backed reservation system inside inventory/user.go and inventory/tx.go. Instead of relying on application-level checks of stale values, the database update itself enforces the quota constraints in a single SQL operation. Below is the patched atomic storage reservation function implemented in the update:

// ReserveStorage atomically adds size bytes to user uid's storage while
// enforcing an optional quota.
func (c *userClient) ReserveStorage(ctx context.Context, uid int, size, maxTotal int64) error {
	if size == 0 {
		return nil
	}
	if size < 0 {
		return c.ReleaseStorage(ctx, uid, -size)
	}
 
	q := c.client.User.Update().Where(user.ID(uid))
	if maxTotal > 0 {
		// storage + size <= maxTotal  <=>  storage <= maxTotal - size
		q = q.Where(user.StorageLTE(maxTotal - size))
	}
	n, err := q.AddStorage(size).Save(ctx)
	if err != nil {
		return err
	}
	if n == 0 {
		return ErrInsufficientCapacity
	}
	return nil
}

By leveraging the user.StorageLTE(maxTotal - size) predicate, the application forces the underlying relational database management system to perform a conditional write. Under standard ACID database isolation levels, the row representing the user is locked during the UPDATE statement. Concurrent transaction threads seeking to modify the same user record will be blocked and serialized, preventing race conditions from manipulating the storage counter.

Exploitation Methodology

Exploitation of this TOCTOU race condition requires only an authenticated account with write access (Files.Write) to the Cloudreve instance. An attacker begins by identifying their active storage quota and their current usage statistics. For instance, if an attacker has an account with a 10 GB limit and has consumed 9.9 GB, they have 100 MB of legitimate remaining capacity.

To trigger the vulnerability, the attacker constructs a script designed to fire a burst of parallel HTTP POST requests targeting the /api/v3/file/upload preparation endpoint. Each request declares a large file payload, such as 5 GB. Under normal execution, any single request of this size would be rejected because 5 GB exceeds the 100 MB remaining space.

When the concurrent requests hit the application, multiple threads handle the incoming payloads in parallel. Because the database row is not locked during the capacity check, every thread reads the stale 9.9 GB usage figure. Each thread verifies that the current usage (9.9 GB) is less than the limit (10 GB) and authorizes the upload session. The server generates upload session tokens for all requests, allowing the attacker to upload multiple 5 GB chunks and exhaust the storage system.

Impact Assessment

The main security impact of CVE-2026-77633 is a storage-based Denial of Service (DoS) and the bypass of system resource boundaries. By default, Cloudreve instances are deployed using local storage policies, where uploaded files are written directly to the host's primary disk partition. Successful exploitation allows a standard user to allocate infinite gigabytes of arbitrary file data.

Once the parallel upload sessions are authorized, the attacker can write chunked payloads directly to the underlying server. Because these sessions were successfully initialized, the application accepts the incoming data chunks, rapidly consuming physical disk space on the host machine. If the underlying partition is exhausted, critical system services and database operations on the host will fail, resulting in an unrecoverable system crash.

This vulnerability is tracked with a CVSS 3.1 base score of 7.1 (High). The impact is limited to availability and integrity, as it does not allow confidentiality leaks or direct remote code execution. However, because it can be exploited using default permissions assigned to standard users, the threat to self-hosted environments remains substantial.

Remediation and Defense

The primary fix for this vulnerability is to upgrade the Cloudreve instance to version 4.18.0 or later. This release restructures the upload flow to enforce storage pre-allocation before file placeholders are created. The patched codebase uses atomic SQL updates to ensure that no two threads can allocate storage based on the same capacity state.

If upgrading is not immediately feasible, system administrators should implement strict rate limiting at the reverse proxy layer. Configuring Nginx or Cloudflare to limit the rate of requests to /api/v3/file/upload prevents attackers from executing parallel requests fast enough to win the race condition. Limiting clients to 1 or 2 active upload preparation connections per second reduces the likelihood of successful exploitation.

Additionally, administrators can mitigate the physical impact by shifting storage policies from local storage to cloud object storage like AWS S3 or Backblaze B2. When utilizing cloud object storage, the local host's disk space is protected from sudden exhaustion. Finally, setting up disk quota monitoring at the operating system level for the user running the Cloudreve service can prevent disk write exhaustion from crashing the entire system host.

Official Patches

CloudreveFix commit implementing atomic database storage allocation logic.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.1/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H
EPSS Probability
0.04%
Top 88% most exploited
2,500
via Shodan

Affected Systems

Cloudreve

Affected Versions Detail

Product
Affected Versions
Fixed Version
Cloudreve
Cloudreve
< 4.18.04.18.0
AttributeDetail
CWE IDCWE-367 / CWE-770
Attack VectorNetwork (AV:N)
CVSS v3.17.1 (High)
Exploit StatusPoC / Conceptual
KEV StatusNot Listed
ImpactDenial of Service (DoS) via Disk Exhaustion

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
T1499Endpoint Denial of Service
Impact
CWE-367
Time-of-Check to Time-of-Use (TOCTOU) Race Condition

The software checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.

Vulnerability Timeline

Vulnerability patched in commit 7329602751c00bb4136fe9ad8b364d0df70773df
2026-07-15
Cloudreve v4.18.0 released containing the fix
2026-09-22
Advisory published and CVE assigned
2026-09-22

References & Sources

  • [1]NVD - CVE-2026-77633
  • [2]GitHub Security Advisory GHSA-xj3h-wwxq-gfcj
  • [3]Cloudreve v4.18.0 Release Notes

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

•about 2 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 3 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
5 views•9 min read
•about 4 hours ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 5 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 6 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 7 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
5 views•10 min read