Repository navigation
Update webpack-dev-middleware to 7.4.6 in Laravel, TypeScript and Webpack examples (CVE-2026-76844) - #125
Open
robocop-the-helper[bot] wants to merge 1 commit into
Conversation
…pack examples webpack-dev-middleware 7.4.5 lets a request such as `/assets../secret` escape the output directory when publicPath has no trailing slash (CVE-2026-76844). 7.4.6 adds the containment check. Pin the patched release through overrides in the three examples that still resolved 7.4.5 via webpack-dev-server, and raise the root pnpm override floor to match. Add a traversal regression test for every example on the 7.x line and make it required in the security test manifest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes https://linear.app/nutrient/issue/SECFIX-154/upgrade-webpack-dev-middleware-to-746-in-nutrient-web-examples-main
Summary
webpack-dev-middleware 7.4.5 lets a request such as
/assets../secretescape the output directory whenpublicPathhas no trailing slash (CVE-2026-76844, GHSA-g84c-rxfj-3j2c). 7.4.6 adds a check that keeps resolved files inside the output directory. Upstream GHSA lists the 7.x affected range as< 7.4.5, but the 7.4.5 → 7.4.6 code diff and a regression test both show 7.4.5 is affected.Three examples still resolved 7.4.5 through webpack-dev-server 5.2.7, all dev-only:
examples/laravel,examples/typescript,examples/webpack: add the override"webpack-dev-middleware": "^7.4.6", the same approach used for elm in fix(examples): patch Elm middleware and Gatsby redirects #116. Each lockfile changes only the webpack-dev-middleware version, resolved URL and integrity; 7.4.6 has the same dependency ranges as 7.4.5.pnpm-workspace.yaml: raise the override floor towebpack-dev-middleware@<7.4.6: ^7.4.6and drop the now-unused[email protected]release-age exception.pnpm-lock.yamlchanges only on the override line.tests/webpack-middleware.test.cjs: add a required traversal test for every example on the 7.x line (angular, elm, laravel, typescript, webpack), registered inscripts/security-test-manifest.cjs.CHANGELOG.md: new Unreleased entry.Unchanged: elm was already fixed in #116, and angular and the root pnpm lockfile were already on 7.4.6. gatsbyjs and react pin 8.6.0, which is past the 8.3.0 fix; moving them to 7.4.6 would be a major-version downgrade.
Exposure was low. The webpack example uses
publicPath: "/", and the typescript and laravel examples don't set one, so none of them shipped with the vulnerable configuration.Verification
pnpm run test:security: 21 of 21 required tests pass. Before the upgrade, the new laravel, typescript and webpack traversal tests failed (HTTP 200 instead of 403).npm ciandnpm ls webpack-dev-middleware --allin all seven affected examples: only 7.4.6 and 8.6.0 remain.pnpm install --frozen-lockfile, andpnpm why webpack-dev-middleware --recursiveshows only 7.4.6.npm run dev).biome ci .,check-biome-versionandtest:pnpm-workflowspass.min-release-age, so the date was checked by hand. The integrity hash matches the 7.4.6 copies already locked in elm, angular and the root lockfile. The package has no npm provenance attestation.The Playwright browser smoke test wasn't run locally because the host lacks Chromium's system libraries; CI's Playwright job covers it. Instead, the typescript example's dev server on 7.4.6 served
/,main.jsandvendor.jswith 200 and returned 403 for traversal paths.