fix(webapp): patch prod-dep vulnerabilities + build on modern Node - #7
fix(webapp): patch prod-dep vulnerabilities + build on modern Node#7hstern wants to merge 2 commits into
Conversation
npm overrides pin the vulnerable transitive deps to patched in-range versions,
plus direct bumps of @babel/runtime and react. Clears BOTH critical advisories
(form-data unsafe boundary RNG; mattermost-redux only inherited it) without the
breaking mattermost-redux 5->11 major bump.
* overrides: form-data ^3.0.4 (was 3.0.0, CRITICAL); moment-timezone ^0.5.35
(was 0.5.32, command injection)
* @babel/runtime ^7.29.7 (was 7.11.2, RegExp-complexity) -- direct dep, so
bumped directly (npm refuses an override on a direct dep)
* react 16.14.0 (was 16.13.1) to satisfy the transitive react-dom@16.14.0 peer
npm audit --omit=dev: 2 critical + 7 moderate -> 0 critical/high, 6 moderate.
The remaining moderates (uuid, nanoid, redux-devtools-core, remote-redux-devtools,
socketcluster-client) only patch via breaking majors under mattermost-redux
5.33.1 and are low real-risk (edge-case CVEs / dev-tooling) -- deferred to the
eventual upstream sync with mattermost-plugin-github.
Verified: npm run check-types passes; npm run build succeeds (with
NODE_OPTIONS=--openssl-legacy-provider, required for webpack 4 on Node 17+).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
webpack 4 (and terser-webpack-plugin) hash with md4, which OpenSSL 3 (Node 17+) removed -> ERR_OSSL_EVP_UNSUPPORTED, so `npm run build` failed on current Node unless run with NODE_OPTIONS=--openssl-legacy-provider. Bake that into the webpack npm scripts via cross-env so `npm run build` / `make dist` just work on Node 17+ (and still on older Node), no manual env needed. Verified: bare `npm run build` succeeds on Node 26; `make dist` produces the plugin bundle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Hi, thanks for the PR. I think the right approach here would be to pull the master branch up to upstream. I've already started doing that — I should be able to continue in about a week and a half, and then test everything thoroughly. |
|
Superseded by #10, which does the upstream resync you suggested ("pull the master branch up to upstream") rather than patching the old base. The two fixes here fold into riding current upstream: the modern toolchain already builds on current Node and pins Closing in favor of #10. Thanks for the steer. |
|
For the record (Issues are disabled on this repo, so noting them here) — three pre-existing bugs surfaced while live-testing the resync in #10. They're present in 2.3.0, not introduced by the resync, and I'm happy to fix each in a follow-up once #10 lands:
|
Two related fixes so the webapp is secure and builds on a current toolchain.
1. Production-dependency vulnerabilities
npm audit --omit=devreported 2 critical + 7 moderate. Cleared both criticals (plus 2 moderates) via npmoverrides+ direct bumps, without the breakingmattermost-redux5→11 major:overrides:form-data ^3.0.4(was 3.0.0) — CRITICAL (unsafe boundary RNG); also clears themattermost-redux"critical", which was flagged only for inheriting it.moment-timezone ^0.5.35(was 0.5.32) — command injection.@babel/runtime ^7.29.7(was 7.11.2) — direct dep, bumped directly (npm refuses an override on a direct dep).react 16.14.0(was 16.13.1) — satisfies the transitivereact-dom@16.14.0peer (also thenpm installERESOLVE blocker).Result: 2 critical + 7 moderate → 0 critical/high, 6 moderate. The remaining 6 (
uuid,nanoid,redux-devtools-core,remote-redux-devtools,socketcluster-client) only patch via breaking majors undermattermost-redux@5.33.1and are low real-risk (edge-case CVEs / dev-tooling).2. Build on modern Node (no manual flag)
webpack 4 + terser-webpack-plugin hash with md4, which OpenSSL 3 (Node 17+) removed →
ERR_OSSL_EVP_UNSUPPORTED, so the build broke on current Node unless run withNODE_OPTIONS=--openssl-legacy-provider. Baked that into the webpack npm scripts viacross-envsonpm run build/make distjust work on Node 17+ (and still on older Node), no manual env.Verification
npm run check-types— passes (no type regressions).npm run build— succeeds on Node 26 (no manualNODE_OPTIONS).make dist— produces the plugin bundle; server compiles for all 5 targets on Go 1.26.Not included (deferred)
mattermost/mattermost-plugin-github.install-go-toolspins golangci-lint@v1.59.1, which won't compile on Go 1.23+. Bumping it (e.g. v1.64.8) compiles on modern Go but surfaces pre-existing lint findings that would failmake check-style— left out of this PR to avoid restyling code / a CI regression; worth pairing with the upstream sync.🤖 Generated with Claude Code