CVE-2026-59429

Regular Expression Denial of Service
Affects
Spring Framework
in
Spring
No items found.
Versions
<=5.2.26.RELEASE, >=5.3.0 <=5.3.50, >=6.0.0 <=6.0.32, >=6.1.0 <=6.1.29, >=6.2.0 <=6.2.20, >=7.0.0 <=7.0.10

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Spring Framework is the foundational application framework of the Spring portfolio, providing dependency injection, transaction management and the Spring MVC and Spring WebFlux web frameworks for building Java applications.

A regular expression denial of service (ReDoS) vulnerability (CVE-2026-59429) has been identified in the PathPattern request matching of Spring Framework, which allows attackers to consume excessive CPU time by sending crafted request paths to an application whose path patterns contain a {name:regex} variable prone to excessive backtracking. This applies to request mappings in Spring MVC and Spring WebFlux applications, as well as to applications that use PathPatternParser directly.

Per OWASP: The Regular expression Denial of Service (ReDoS) is a Denial of Service attack, that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). An attacker can then cause a program using a Regular Expression (Regex) to enter these extreme situations and then hang for a very long time.

This issue affects multiple versions of Spring Framework.

Details

Module Info

Vulnerability Info

This Low-severity vulnerability is found in the spring-web package in multiple versions of Spring Framework. PathPattern, the parsed form of a request mapping path used by Spring MVC and Spring WebFlux, turns a path segment that contains a {name:regex} variable into a CaptureVariablePathElement (when the segment is only the variable) or a RegexPathElement (when the segment mixes the variable with literal text or wildcards). When a request is matched, each element runs its compiled regular expression directly against the request path segment, with no bound on the work the regular expression engine may do:

// RegexPathElement.matches()
String textToMatch = matchingContext.pathElementValue(pathIndex);
Matcher matcher = this.pattern.matcher(textToMatch);
boolean matches = matcher.matches();

// CaptureVariablePathElement.matches()
Matcher matcher = this.constraintPattern.matcher(candidateCapture);

The path segment comes straight from the incoming request, so an unauthenticated attacker controls the text being matched. If the developer's constraint regular expression has nested or overlapping quantifiers, such as (?:.*a){12}b, the java.util.regex engine backtracks through an exponential number of ways to split a segment that almost matches before it gives up. A request whose path segment is a long run of characters that nearly satisfies the pattern therefore keeps a request-handling thread busy for seconds or longer during routing, before any controller code runs, and repeated requests can exhaust the server's CPU.

Steps to Reproduce

  1. Add org.springframework:spring-web 6.2.19 (with its spring-core and spring-jcl dependencies) to the classpath.
  2. Run the following program, which parses a path pattern with a backtracking-prone {name:regex} variable and matches it against near-miss request paths of growing length:
import org.springframework.http.server.PathContainer;
import org.springframework.web.util.pattern.PathPattern;
import org.springframework.web.util.pattern.PathPatternParser;

public class Repro {
    public static void main(String[] args) {
        PathPattern pattern = new PathPatternParser().parse("/files/{name:(?:.*a){12}b}");
        for (int n : new int[] {20, 24, 28, 40}) {
            String path = "/files/" + "a".repeat(n) + "c";
            long start = System.nanoTime();
            boolean matched = pattern.matches(PathContainer.parsePath(path));
            System.out.printf("n=%d matched=%b in %d ms%n", n, matched, (System.nanoTime() - start) / 1_000_000);
        }
    }
}
  1. Observe that the matching time grows rapidly with the segment length: it multiplies several times with every four extra characters, taking over a second for 28 characters, while 40 characters keeps the thread busy for minutes.

Mitigation

Only recent versions of Spring Framework receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to a currently supported version of Spring Framework.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credits

YLChen-007 (finder)

Aditya Bavadekar (finder)

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Low
ID
CVE-2026-59429
PROJECT Affected
Spring Framework
Versions Affected
<=5.2.26.RELEASE, >=5.3.0 <=5.3.50, >=6.0.0 <=6.0.32, >=6.1.0 <=6.1.29, >=6.2.0 <=6.2.20, >=7.0.0 <=7.0.10
NES Versions Affected
Published date
November 19, 2026
≈ Fix date
Category
Regular Expression Denial of Service
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Spring
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.