Repository navigation
Update npm lockfile to fix npm audit advisories - #1620
Merged
Merged
Conversation
npm audit reported 33 advisories (3 critical, 15 high), all in transitive build-time dependencies of laravel-mix and webpack. Ran npm audit fix, which clears 25 of them, including proxy-addr, shell-quote, websocket-driver, fast-uri, postcss, svgo and follow-redirects (now 1.16.2, which supersedes PR #1618 by katsugtgz). webpack is pinned to ~5.106.2. npm audit fix moved it to 5.112.2, but 5.107.0 removed webpack/lib/SizeFormatHelpers, which laravel-mix 6 requires, so the build failed. 5.106.2 is the last release that still ships it, and it includes the fixes for both webpack advisories (patched in 5.104.1). A fresh npm run dev now produces output byte-identical to the committed public/ assets. The remaining 8 advisories have no fix within laravel-mix 6: elliptic and its parents (no patched elliptic exists, and it is not bundled into public/js/app.js), and webpack-dev-server 4 / webpack-dev-middleware, which laravel-mix pins and which are only used by npm run hot.
5.106.2 has SizeFormatHelpers, but 5.106.0 started rejecting the extra ProgressPlugin options webpackbar passes, so npm run dev fails. 5.105.4 is the newest release that builds, and it still includes the fixes for both webpack advisories (patched in 5.104.1).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
npm auditreported 33 advisories on2.x(3 critical, 15 high). All of them are in build-time dependencies oflaravel-mixandwebpack, none of which ship in the app. This clears 25 of them.What changed
npm audit fix, which only changespackage-lock.json. It fixes proxy-addr, shell-quote and websocket-driver (critical), plus fast-uri, postcss, svgo, body-parser, compression, js-yaml, launch-editor, nanoid, node-forge, brace-expansion, browserslist, source-map-js and others.webpackto~5.105.4.npm audit fixraised it to 5.112.2, which breakslaravel-mix6 in two ways: 5.106.0 started rejecting the extra ProgressPlugin options thatwebpackbarpasses, and 5.107.0 removedwebpack/lib/SizeFormatHelpers. 5.105.4 is the newest release that builds, and it already includes the fixes for both webpack advisories (patched in 5.104.1). The first commit pinned 5.106.2, which failed CI; the second commit fixes that.follow-redirectsis now 1.16.2, so this supersedes Bump follow-redirects from 1.16.0 to 1.16.1 in package-lock.json #1618 (thanks katsugtgz).Checks
npm ci,npm run devbuilds successfully andnpm run lintpasses.public/js/app.jsis byte-identical.public/css/app.cssdiffers in one line: autoprefixer no longer adds-webkit-backdrop-filter, because the newer browser-support data says current Safari handles the unprefixed property. This PR doesn't rebuildpublic/, so the shipped assets don't change.Left over (8 advisories)
These have no fix while we're on
laravel-mix6:elliptic→browserify-sign/create-ecdh→crypto-browserify→node-libs-browser(all low). No patchedellipticexists, and none of it ends up inpublic/js/app.js, because the scripts are concatenated and run through Babel, not bundled.webpack-dev-server4 andwebpack-dev-middleware(high).laravel-mixpins^4, and they're only used bynpm run hot.Clearing these means moving off
laravel-mix, for example to Vite withlaravel-vite-plugin. I'll handle that separately.