body-parser@1.8.0

Node.js body parsing middleware

  • latest version

    2.4.0

  • latest non vulnerable version

  • first published

    12 years ago

  • latest version published

    2 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the body-parser 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
    • H
    Uncaught Exception

    Affected versions of this package are vulnerable to Uncaught Exception via the read function in lib/read.js when processing a compressed request body that contains trailing bytes. An attacker can send a compressed body with trailing data, causing the decompression stream to emit an error on an already-finished stream with no error listener attached, which crashes the Node.js process.

    How to fix Uncaught Exception?

    Upgrade body-parser to version 1.20.9, 2.4.0 or higher.

    <1.20.9>=2.0.0 <2.4.0
    • M
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to invalid limit option handling in normalizeOptions in lib/utils.js. An attacker can force oversized request bodies through by supplying an application configuration value for limit that parses to null, such as an unparseable string or NaN. When an app relies on limit to cap body size, the parser skips enforcement and accepts arbitrarily large payloads, driving excessive memory and CPU usage and degrading or crashing the service.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade body-parser to version 1.20.6, 2.3.0 or higher.

    <1.20.6>=2.0.0-beta.1 <2.3.0
    • H
    Asymmetric Resource Consumption (Amplification)

    Affected versions of this package are vulnerable to Asymmetric Resource Consumption (Amplification) via the extendedparser and urlencoded functions when the URL encoding process is enabled. An attacker can flood the server with a large number of specially crafted requests.

    How to fix Asymmetric Resource Consumption (Amplification)?

    Upgrade body-parser to version 1.20.3 or higher.

    <1.20.3