Denial of Service Vulnerability in libspring-java: Spring MVC @RequestBody byte[] Parameter

libspring-java Updated 02 Oct 2025

Summary

18/11/2024
N/A
No i
Unrated
Not published

CVE-2024-38828: Spring MVC controller methods with an @RequestBody byte[] method parameter are vulnerable to a DoS attack. Affects libspring-java versions 4.3.30-1 – 4.3.30-3. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

libspring-java is a widely used library in the Spring Framework that facilitates the development of Java-based web applications. It provides essential features for building robust MVC (Model-View-Controller) applications, including request handling, data binding, and validation. However, recent findings have revealed a vulnerability in the handling of byte array parameters in Spring MVC controller methods, which can lead to Denial of Service (DoS) attacks.

Vulnerability Detail

The vulnerability arises from the way Spring MVC processes incoming requests with @RequestBody byte[] parameters. An attacker can exploit this by sending specially crafted requests that consume excessive server resources, potentially leading to service unavailability. This issue is particularly concerning for applications that rely heavily on Spring MVC for handling large data uploads or streaming, as it can result in significant performance degradation or complete service outages.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary measure, you can implement input validation to limit the size of incoming byte array requests. This can be done by adding a filter in your Spring application that checks the size of the request body before processing it. For example:

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;

public class RequestSizeFilter implements Filter {
    private static final int MAX_SIZE = 1048576; // 1 MB

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        if (request.getContentLength() > MAX_SIZE) {
            throw new ServletException("Request size exceeds limit.");
        }
        chain.doFilter(request, response);
    }

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {}

    @Override
    public void destroy() {}
}

Conclusion

The CVE-2024-38828 vulnerability in libspring-java poses a significant risk to applications using Spring MVC. By understanding the nature of this vulnerability and taking appropriate steps to mitigate it, such as updating the package and implementing input validation, developers can protect their applications from potential Denial of Service attacks.

See every vulnerability recorded for libspring-java →

Share this vulnerability

FAQ

CVE-2024-38828 is a vulnerability in the libspring-java package that allows for Denial of Service attacks through the misuse of @RequestBody byte[] parameters in Spring MVC controller methods.

If your application uses Spring MVC and processes byte array requests, it may be susceptible to resource exhaustion, leading to degraded performance or complete service outages.

Yes, updating to the latest version of the libspring-java package will address this vulnerability. Ensure to check your package manager for the latest updates.

Implement input validation to restrict the size of incoming requests as a temporary workaround until you can apply the patch.

You can use Vulert, which monitors open-source vulnerabilities in your software using just a manifest file like package-lock.json. You can check your application for vulnerabilities in real-time using the Vulert playground without any signup.

Related vulnerabilities

Recent vulnerabilities recorded for libspring-java.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback