Skip to main content
Vulnerability Database/CVE-2025-32959

CVE-2025-32959: CUBA Platform DOS Vulnerability

CVE-2025-32959 is a denial of service vulnerability in CUBA Platform that allows attackers to exhaust server storage through unrestricted file uploads. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-32959 Overview

CVE-2025-32959 is a denial of service vulnerability in CUBA Platform, a high-level framework for enterprise application development. The local file storage implementation in versions prior to 7.2.23 does not restrict the size of uploaded files. An authenticated attacker can upload excessively large files to exhaust server disk space. The server then returns HTTP 500 errors and denies service to legitimate users. The issue is tracked under [CWE-770: Allocation of Resources Without Limits or Throttling]. Maintainers patched the flaw in version 7.2.23, and a workaround is published on the Jmix documentation website.

Critical Impact

Authenticated attackers can exhaust server storage through unbounded file uploads, causing availability loss across the CUBA Platform application.

Affected Products

  • CUBA Platform versions prior to 7.2.23
  • Applications using the CUBA local file storage implementation
  • Jmix-based deployments that retain the legacy CUBA files endpoint

Discovery Timeline

  • 2025-04-22 - CVE-2025-32959 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-32959

Vulnerability Analysis

The vulnerability resides in the FileStorage component of CUBA Platform's core module. The local file storage implementation accepts uploaded content without enforcing an upper bound on file size. When a client streams a large payload to the files endpoint, the server writes the entire stream to disk using IOUtils.copyLarge(inputStream, os) without a byte-count ceiling.

An authenticated user with upload privileges can submit arbitrarily large payloads, or repeatedly submit moderate files, until the underlying file system runs out of space. Once the disk fills, subsequent write operations fail and the application returns HTTP 500 errors. This affects both file uploads and other application features that depend on local disk capacity, such as logging and session persistence.

Root Cause

The root cause is missing size validation in the file write path, categorized as [CWE-770]. The ServerConfig interface did not expose a fileStorageMaxFileSize property, and the storage routine did not consult any limit before copying the input stream. Without a configurable cap or a check for residual bytes after the copy completed, the implementation could not reject oversized uploads.

Attack Vector

Exploitation requires network access to the application and valid credentials with permission to invoke the files endpoint. The attacker issues one or more HTTP file upload requests containing payloads large enough to consume available disk space. No user interaction or privilege escalation is required beyond the initial authenticated session.

java
// Security patch applied to FileStorage.java
// Source: https://github.com/cuba-platform/cuba/commit/42b6c00fd0572b8e52ae31afd1babc827a3161a1
ServerConfig serverConfig = configuration.getConfig(ServerConfig.class);
long maxAllowedSize = serverConfig.getFileStorageMaxFileSize().toBytes();
long size = 0;
OutputStream os = null;
try {
    os = FileUtils.openOutputStream(file);
    size = IOUtils.copyLarge(inputStream, os, 0, maxAllowedSize);

    if (size >= maxAllowedSize) {
        if (inputStream.read() != IOUtils.EOF) {
            os.close();
            if (file.exists()) {
                if (!file.delete()) {
                    log.warn("Failed to delete an incorrectly uploaded file '{}'. " +
                                    "File was to large and has been rejected but already loaded part was not deleted.",
                            file.getAbsolutePath());
                }
            }
            throw new FileStorageException(FileStorageException.Type.IO_EXCEPTION,
                    String.format("File is too large: '%s'. Max file size = %s MB is exceeded but there are unread bytes left.",
                            file.getAbsolutePath(),
                            serverConfig.getFileStorageMaxFileSize().toMegabytes()));
        }
    }
    os.flush();

The patch introduces a maxAllowedSize ceiling, caps IOUtils.copyLarge at that boundary, and raises a FileStorageException if the stream still has unread bytes after the limit is reached.

Detection Methods for CVE-2025-32959

Indicators of Compromise

  • Rapid disk space consumption on servers hosting the CUBA Platform file storage directory
  • Spikes in HTTP 500 responses from the application's files endpoint following a series of large uploads
  • Unusually large files, or many files in quick succession, written by a single authenticated user account

Detection Strategies

  • Review application logs for repeated FileStorageException entries and failed write operations against the local storage path
  • Baseline normal upload sizes per user and alert on outliers that exceed typical business file dimensions
  • Correlate authentication logs with upload activity to identify accounts generating anomalous storage volume

Monitoring Recommendations

  • Monitor file system utilization on the volume hosting CUBA file storage and alert at defined thresholds
  • Track request rate and payload size at the HTTP layer for endpoints that map to CUBA file upload handlers
  • Instrument the files endpoint with per-user upload quotas and emit metrics when quotas are approached

How to Mitigate CVE-2025-32959

Immediate Actions Required

  • Upgrade CUBA Platform to version 7.2.23 or later, which enforces a configurable fileStorageMaxFileSize cap
  • If the files endpoint is not required, disable it following the Disable Files Endpoint Instruction
  • Audit role assignments to minimize the number of accounts that can invoke file upload functionality

Patch Information

The fix is delivered in CUBA Platform version 7.2.23 via commit 42b6c00. The patch adds a DataSize-typed configuration property fileStorageMaxFileSize to ServerConfig and enforces it in FileStorage by capping IOUtils.copyLarge and rejecting streams that exceed the limit. Full advisory details are available in GHSA-w3mp-6vrj-875g and the companion Jmix advisory GHSA-f3gv-cwwh-758m.

Workarounds

  • Apply the workaround documented in the Jmix Vulnerabilities Documentation to constrain the files endpoint
  • Enforce an upstream request size limit at the reverse proxy or load balancer to reject oversized uploads before they reach the application
  • Place the CUBA file storage directory on a dedicated volume with reserved capacity to isolate exhaustion from the host operating system
bash
# Example nginx configuration to cap upload size at 20 MB
http {
    client_max_body_size 20m;

    server {
        location /dispatch/upload {
            client_max_body_size 20m;
            proxy_pass http://cuba_backend;
        }
    }
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.