Skip to content

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
mainfrom
support-agent/linear-0d5a7aff-811e-4f10-962c-02548afc3a29-0e054639-ef75-4039-86d8-39f68bd1bcc1
Open

robocop-the-helper[bot] wants to merge 1 commit into
mainfrom
support-agent/linear-0d5a7aff-811e-4f10-962c-02548afc3a29-0e054639-ef75-4039-86d8-39f68bd1bcc1

Conversation

@robocop-the-helper

Copy link
Copy Markdown
Contributor

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../secret escape the output directory when publicPath has 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 to webpack-dev-middleware@<7.4.6: ^7.4.6 and drop the now-unused [email protected] release-age exception. pnpm-lock.yaml changes 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 in scripts/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 ci and npm ls webpack-dev-middleware --all in all seven affected examples: only 7.4.6 and 8.6.0 remain.
  • Root pnpm install --frozen-lockfile, and pnpm why webpack-dev-middleware --recursive shows only 7.4.6.
  • Builds pass for typescript, webpack and laravel (npm run dev).
  • biome ci ., check-biome-version and test:pnpm-workflows pass.
  • Release age: 7.4.6 was published 2026-09-03, 81 days before this change and well past the 7-day policy. npm 11.6.2 doesn't enforce 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.js and vendor.js with 200 and returned 403 for traversal paths.

…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]>
@robocop-the-helper
robocop-the-helper Bot marked this pull request as ready for review November 23, 2026 21:29
@robocop-the-helper
robocop-the-helper Bot requested a review from a team as a code owner November 23, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants