fix: security issue with webpack buildHttp (#12027)

This commit is contained in:
Michal Klos authored and GitHub committed 2026-02-17 14:19:35 +01:00
1 parent d9c5ec826f
commit d70ae42427
3 files changed
+211 -298

No files matched your search

+1 -1
View File
@@ -163,7 +163,7 @@
"source-map-explorer": "^2.5.3",
"typescript": "^5.9.3",
"url-loader": "4.1.1",
"webpack": "5.96.1",
"webpack": "5.104.1",
"webpack-manifest-plugin": "5.0.1",
"workbox-webpack-plugin": "7.1.0"
},
+197 -296
View File
File diff suppressed because it is too large. Load diff
+13 -1
View File
@@ -26,6 +26,13 @@ const ESLintPlugin = require('eslint-webpack-plugin')
const postcssNormalize = require('postcss-normalize')
const appPackageJson = require(paths.appPackageJson)
const babelPresetReactAppPath = require.resolve('babel-preset-react-app')
const babelRuntimeHelpersPath = require.resolve('@babel/runtime/helpers/esm/assertThisInitialized', {
paths: [babelPresetReactAppPath]
})
const babelRuntimeRegeneratorPath = require.resolve('@babel/runtime/regenerator', {
paths: [babelPresetReactAppPath]
})
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'
@@ -273,7 +280,12 @@ module.exports = function (webpackEnv) {
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson])
new ModuleScopePlugin(paths.appSrc, [
paths.appPackageJson,
babelPresetReactAppPath,
babelRuntimeHelpersPath,
babelRuntimeRegeneratorPath
])
]
},
resolveLoader: {