Skip to content

[Snyk] Security upgrade webpack from 1.15.0 to 2.2.0 #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixtures/packaging/webpack/prod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"name": "webpack-prod-fixture",
"dependencies": {
"webpack": "^1.14.0"
"webpack": "^2.2.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading webpack from v1 to v2 is a major version bump that introduces breaking changes. The current webpack configuration in fixtures/packaging/webpack/prod/config.js is not compatible with webpack v2 and will cause the build for this fixture to fail.

Specifically, the resolve.root option used in the config has been removed in webpack v2. It should be replaced with resolve.modules.

The configuration file needs to be updated for this dependency upgrade to work. For example:

// in fixtures/packaging/webpack/prod/config.js
resolve: {
  modules: [
    path.resolve('../../../../build/node_modules/'),
    'node_modules' // Also recommended to keep resolving from node_modules
  ],
},

Without this change, the yarn build script for this fixture will fail.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This PR only upgrades the webpack dependency for the prod fixture. However, the dev fixture at fixtures/packaging/webpack/dev/package.json still uses the old, vulnerable version (webpack: "^1.14.0").

To fully address the security vulnerability and maintain consistency, the dev fixture's dependencies should also be upgraded. Note that its configuration file, fixtures/packaging/webpack/dev/config.js, will also require updates to be compatible with webpack v2.

},
"scripts": {
"build": "rm -f output.js && webpack --config config.js"
Expand Down
Loading