org.mvnpm:http-proxy-middleware@2.0.10

  • latest version

    4.2.1

  • first published

    1 years ago

  • latest version published

    1 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:http-proxy-middleware 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
    HTTP Request Smuggling

    Affected versions of this package are vulnerable to HTTP Request Smuggling via fixRequestBody in src/handlers/fix-request-body.ts, which uses req.readableLength === 0 as proof that a body parser has consumed the request body, when that same value is observed before any body byte has arrived. A remote unauthenticated attacker can send request headers first, wait one event-loop turn, and then send a body containing a complete second HTTP/1.1 request. When a body-parser 1.x parser has declined the declared media type, it assigns a truthy req.body without consuming the stream; fixRequestBody then serializes that empty body, rewrites the upstream Content-Length to zero, and writes it before the still-live request stream is piped upstream. The backend consumes the synthesized zero-length body and parses the attacker's withheld bytes as a second request on the persistent connection, bypassing the gateway's route filter, explicit path denials, and trusted-header normalization, and on a pooled upstream connection an attacker-controlled following request can receive the smuggled response.

    Note: This is only exploitable when a body-parser 1.x parser runs before the proxy and declines the request media type (leaving a truthy req.body and an unread stream), fixRequestBody is registered as on.proxyReq, the request body arrives after the headers in a later event-loop turn, and the upstream connection remains persistent (the default from 4.0.0-beta.2; on 2.x, 3.x, and 4.0.0-beta.0 a pooling agent or an explicit client Connection: keep-alive header is required).

    How to fix HTTP Request Smuggling?

    Upgrade org.mvnpm:http-proxy-middleware to version 3.0.3, 4.2.1 or higher.

    [2.0.9,3.0.3)[3.0.5,4.2.1)
    • H
    Uncaught Exception

    Affected versions of this package are vulnerable to Uncaught Exception via the handleUpgrade function when ws: true is enabled. An Upgrade request whose path does not match pathFilter leaves the raw socket without an error listener, so a remote unauthenticated client can send such an Upgrade request and then reset the TCP connection, triggering an unhandled ECONNRESET error that terminates the gateway process. This crash occurs even when middleware and server error and clientError callbacks are configured.

    How to fix Uncaught Exception?

    A fix was pushed into the master branch but not yet published.

    [0,)