Vulnerabilities

2 via 2 paths

Dependencies

1

Source

GitHub

Commit

e91980fa

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
  • 1
Status
  • 2
  • 0
  • 0

high severity
new

Incomplete Filtering of One or More Instances of Special Elements

  • Vulnerable module: validator
  • Introduced through: validator@13.7.0

Detailed paths

  • Introduced through: fluent-ts-validator@markusbohl/fluent-ts-validator#e91980fa9634293b8c15d3b0f15b092331fca48f validator@13.7.0
    Remediation: Upgrade to validator@13.15.22.

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Incomplete Filtering of One or More Instances of Special Elements in the isLength() function that does not take into account Unicode variation selectors (\uFE0F, \uFE0E) appearing in a sequence which lead to improper string length calculation. This can lead to an application using isLength for input validation accepting strings significantly longer than intended, resulting in issues like data truncation in databases, buffer overflows in other system components, or denial-of-service.

PoC

Input;

const validator = require('validator');

console.log(`Is "test" (String.length: ${'test'.length}) length less than or equal to 3? ${validator.isLength('test', { max: 3 })}`);
console.log(`Is "test" (String.length: ${'test'.length}) length less than or equal to 4? ${validator.isLength('test', { max: 4 })}`);
console.log(`Is "test\uFE0F\uFE0F\uFE0F\uFE0F" (String.length: ${'test\uFE0F\uFE0F\uFE0F\uFE0F'.length}) length less than or equal to 4? ${validator.isLength('test\uFE0F\uFE0F\uFE0F', { max: 4 })}`);

Output:

Is "test" (String.length: 4) length less than or equal to 3? false
Is "test" (String.length: 4) length less than or equal to 4? true
Is "test️️️️" (String.length: 8) length less than or equal to 4? true

Remediation

Upgrade validator to version 13.15.22 or higher.

References

medium severity

Improper Validation of Specified Type of Input

  • Vulnerable module: validator
  • Introduced through: validator@13.7.0

Detailed paths

  • Introduced through: fluent-ts-validator@markusbohl/fluent-ts-validator#e91980fa9634293b8c15d3b0f15b092331fca48f validator@13.7.0
    Remediation: Upgrade to validator@13.15.20.

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Improper Validation of Specified Type of Input in the isURL() function which does not take into account : as the delimiter in browsers. An attackers can bypass protocol and domain validation by crafting URLs that exploit the discrepancy in protocol parsing that can lead to Cross-Site Scripting and Open Redirect attacks.

Remediation

Upgrade validator to version 13.15.20 or higher.

References