Skip to content

fix(examples): patch Elm middleware and Gatsby redirects - #116

Open
MahmoudElsayad wants to merge 1 commit into
mainfrom
mahmoud/nov6-middleware-security
Open

MahmoudElsayad wants to merge 1 commit into
mainfrom
mahmoud/nov6-middleware-security

Conversation

@MahmoudElsayad

Copy link
Copy Markdown
Contributor

Why

Elm still locks webpack-dev-middleware 7.4.5, which the upstream advisory lists as vulnerable to CVE-2026-76844. Gatsby still pins follow-redirects 1.16.1, affected by cross-realm credential disclosure. These remain after #114.

What changed

Pin Elm middleware to 7.4.6 and Gatsby follow-redirects to 1.16.2, then regenerate their npm lockfiles. Add a seven-day age floor for root pnpm tooling and conservative npm resolution cutoffs for the two examples. Their READMEs explain how to advance the cutoff while preserving seven days.

Scope

Gatsby 5.16.1 still requires middleware ^5.3.4. No patched 5.x release exists, so this PR documents the upstream trailing-slash workaround instead of forcing an unsupported major override. Gatsby defaults to /; custom GATSBY_WEBPACK_PUBLICPATH values must also end with /. https://github.com/PSPDFKit/nutrient-web-examples/security/dependabot/1691 remains open.

The middleware advisory is GHSA-g84c-rxfj-3j2c. The redirect alert is https://github.com/PSPDFKit/nutrient-web-examples/security/dependabot/1864. npm published the selected fixes on September 3 and October 25, respectively. Both pass the seven-day cooldown on November 6. No new cooldown exemption is added.

Verification

  • Local HTTP reproductions leaked test data with middleware 7.4.5 and follow-redirects 1.16.1. After the update, middleware returns 403 and the redirect destination receives no custom credential.
  • Frozen root installation, both npm clean installations, Elm's two Playwright tests, Gatsby's seven regression tests, Gatsby production build, and root pnpm workflow tests pass.
  • Focused browser checks render document pages in both examples without viewer errors. Biome passes for both manifests, and git diff --check passes.

The local security harness lives outside the repository. npm audit reports two moderate findings for Elm and 20 findings for Gatsby, including four high findings. Neither updated dependency has an audit finding in its updated example. Gatsby middleware remains one of the high findings. Other agents own the remaining security work.

@MahmoudElsayad MahmoudElsayad self-assigned this Nov 5, 2026
@MahmoudElsayad
MahmoudElsayad marked this pull request as ready for review November 5, 2026 23:12
@MahmoudElsayad
MahmoudElsayad requested a review from a team as a code owner November 5, 2026 23:12

@miguelcalderon miguelcalderon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, the two fixes look right and the Gatsby workaround is well explained. Two things before merging: Elm still has a follow-redirects 1.16.1 pin, and the fixed date in .npmrc will freeze installs over time. A rolling min-release-age=7 would keep the seven-day rule without anyone having to update a date.

Comment thread examples/elm/package.json
@@ -36,6 +36,7 @@
"follow-redirects": "1.16.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This still pins follow-redirects to 1.16.1, the version this PR calls unsafe. The lockfile gets 1.16.2 only because http-proxy is the sole user and its nested override wins. Can we bump this to 1.16.2 too, like Gatsby?

Comment thread examples/elm/.npmrc
@@ -0,0 +1 @@
before=2026-10-30T00:00:00Z

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A fixed date never moves, so over time this stops being a seven-day buffer and just freezes new installs at October 2026. People who copy this example and add packages will get old versions without knowing why. npm 11.10+ has a rolling setting, min-release-age=7, that matches the root minimumReleaseAge. Could we use that here and in Gatsby, and drop the README note about moving the date?


## Development server security

Gatsby 5.16.1 requires `webpack-dev-middleware` 5.3.4, which has no patched release within its supported major version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small wording fix: Gatsby needs ^5.3.4, not exactly 5.3.4, and the real problem is that the whole 5.x line has no fix. Maybe: "Gatsby 5.16.1 uses webpack-dev-middleware 5.x, which has no fixed release."

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.

2 participants