Vulnerabilities

1 via 2 paths

Dependencies

220

Source

GitHub

Commit

f2fbff92

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
Status
  • 1
  • 0
  • 0

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: qs
  • Introduced through: express@4.21.2

Detailed paths

  • Introduced through: simorgh@bbc/simorgh#f2fbff92d327498959e01e2c4fa067e0921b84f5 express@4.21.2 qs@6.13.0
    Remediation: Upgrade to express@4.22.0.
  • Introduced through: simorgh@bbc/simorgh#f2fbff92d327498959e01e2c4fa067e0921b84f5 express@4.21.2 body-parser@1.20.3 qs@6.13.0
    Remediation: Upgrade to express@4.22.0.

Overview

qs is a querystring parser that supports nesting and arrays, with a depth limit.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via improper enforcement of the arrayLimit option in bracket notation parsing. An attacker can exhaust server memory and cause application unavailability by submitting a large number of bracket notation parameters - like a[]=1&a[]=2 - in a single HTTP request.

PoC


const qs = require('qs');
const attack = 'a[]=' + Array(10000).fill('x').join('&a[]=');
const result = qs.parse(attack, { arrayLimit: 100 });
console.log(result.a.length);  // Output: 10000 (should be max 100)

Remediation

Upgrade qs to version 6.14.1 or higher.

References