REDHAT-BUG-2491525: Medium severity npm/http-proxy-middleware vulnerability

Published Jun 22, 2026
·
Updated

http-proxy-middleware is node.js http-proxy middleware. From 3.0.4 until 3.0.7 and 4.1.1, fixRequestBody() is the library's documented helper for re-emitting a request body that was already consumed by a body parser. When the outgoing Content-Type is multipart/form-data, it rebuilds the body with handlerFormDataBodyData(), which interpolates each req.body key and value directly into the multipart wire format without neutralizing CR/LF. A \r\n inside a value (or key) lets an attacker close the current part and inject an entirely new form part. Because the proxy's own body parser saw a single opaque value, any gateway-side policy or validation performed on req.body is evaluated against a different set of fields than the upstream backend ultimately parses a request/parameter desynchronization across the trust boundary. This vulnerability is fixed in 3.0.7 and 4.1.1.

Affected Software

1 affected component
npm/http-proxy-middleware>=3.0.4<3.0.7, >=4.1.1<=4.1.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade http-proxy-middleware to a version that resolves this vulnerability.

    Fixed in 3.0.7
  2. Upgrade

    Upgrade http-proxy-middleware to a version that resolves this vulnerability.

    Fixed in 4.1.1

Event History

Jun 22, 2026
Data Sourced
via Red Hat·09:02 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Applications using http-proxy-middleware versions from 3.0.4 through before 3.0.7, or version 4.1.1 before its fix, are exposed when they use fixRequestBody() after a body parser has consumed a request and send the proxied request as multipart/form-data.

2

What does an attacker need to exploit it?

An attacker needs control of a request body key or value that reaches req.body and can include CR/LF characters. The proxy must then rebuild that body with fixRequestBody() for an outgoing multipart/form-data request.

3

What is the practical impact?

CR/LF characters can terminate a multipart form part and inject additional parts. This can cause gateway validation or policy decisions to be made on different fields than those parsed by the upstream backend.

4

What should be done if upgrading is not immediately possible?

Avoid using fixRequestBody() to re-emit multipart/form-data bodies containing attacker-controlled keys or values. Ensure such values cannot contain CR/LF before the proxy reconstructs the multipart request.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203