Skip to content

Upgrade qs to version 6.14.1 #417

@gerhardK71475

Description

@gerhardK71475

Overview

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions