optimize: fix frontend security vulnerabilities #7704
+8,417
−8,748
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR addresses frontend security vulnerabilities reported by GitHub Dependabot by upgrading webpack from version 4 to version 5 and updating related dependencies to their latest secure versions.
Security Impact
console-fe
saga-designer
Key Vulnerabilities Fixed
webpack-dev-server (Moderate - GHSA-9jgg-88mc-972h, GHSA-4v9v-hfq4-rm2v)
serialize-javascript (High - GHSA-h9rv-jmmf-4pgx, GHSA-hxcc-f52p-wc94)
braces (High - GHSA-grv7-fg5c-xmjg)
micromatch (Moderate - GHSA-952p-6rrq-rcjv)
nanoid (Moderate - GHSA-mwcw-c2x4-8c55)
svelte/swiper (Moderate - GHSA-8266-84wp-wv5c)
Changes Made
Major Upgrade
Dependency Updates (console-fe)
Package Overrides (console-fe)
Updated package.json overrides to enforce secure versions:
Configuration Updates (console-fe)
webpack.prod.conf.js
to use TerserPlugin and CssMinimizerPluginwebpack.base.conf.js
to use webpack 5 syntax (resolve.fallback
instead of deprecatednode.fs
)Dependency Updates (saga-designer)
Testing
✅ npm install successful on both projects
✅ npm run build successful on both projects
✅ npm audit confirms vulnerability reduction
✅ Build output sizes within expected range
✅ Webpack 5 configuration properly migrated
Remaining Issues
5 low severity vulnerabilities remain in console-fe, all related to
@alicloud/console-components-console-menu
dependency:These vulnerabilities have no fix available and require the vendor (@alicloud) to update their dependencies. Risk assessment: LOW.
Breaking Changes
This PR includes a major version upgrade from webpack 4 to webpack 5. While the build process has been tested and verified, it's recommended to:
npm run start
References
slievrly#7