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

DoS Vulnerability was discovered in io.vavr:vavr:0.10.4 #2753

Closed
Alex111998 opened this issue Nov 27, 2023 · 2 comments
Closed

DoS Vulnerability was discovered in io.vavr:vavr:0.10.4 #2753

Alex111998 opened this issue Nov 27, 2023 · 2 comments

Comments

@Alex111998
Copy link

Summary

A denial of service vulnerability in vavr was discovered by CIFuzz. A bug in method CharSeq.repeat(char, int) means that an input of modest size can lead to indefinite amounts of memory being used. Can recurrent it like follows code.

POC

pom

<dependency>
        <groupId>io.vavr</groupId>
        <artifactId>vavr</artifactId>
        <version>0.10.4</version>
</dependency>

code

public static void main(String[] args) {
        CharSeq.repeat('a', 762526009);
}

Attack

image

@chaotic3quilibrium
Copy link

chaotic3quilibrium commented Dec 13, 2023

I don't understand how this is a DoS vulnerability?

What is the suggested remediation? Perhaps that would better explain how it is a DoS.

@pivovarit
Copy link
Member

I can imagine how this can be recognized as Dos Vulnerability: if you are certain that some application is using it, you could force some extra memory consumption leading to its collapse.

But there's not much we can do about it: if you want to create a String instance legally, it involves some array copying. That's how String and StringBuilder works. There are easier and more efficient ways to induce OOMEs.

Also, this method is often used in demos and tests and not in production code, which makes it effectively harmless

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

No branches or pull requests

3 participants