Skip to content

fix: address dependency CVEs (handlebars, hbs, tar, serialize-javascript)#8543

Open
hectormmg wants to merge 12 commits into
devfrom
dependency-updates
Open

fix: address dependency CVEs (handlebars, hbs, tar, serialize-javascript)#8543
hectormmg wants to merge 12 commits into
devfrom
dependency-updates

Conversation

@hectormmg
Copy link
Copy Markdown
Member

@hectormmg hectormmg commented Apr 20, 2026

Summary

Addresses multiple dependency vulnerabilities:

  • Upgrade handlebars 4.7.8 -> 4.7.9
  • Upgrade hbs 4.2.0 -> 4.2.1
  • Fix tar CVE: Add overrides.tar = \"7.5.13\" to fix the path via @angular/cli 19 -> pacote. tar now resolves to exactly 7.5.13 across all transitive consumers.
  • Fix serialize-javascript CVE (code injection via RegExp.flags/Date.toISOString): Upgrade @rollup/plugin-terser from ^0.4.0 -> ^1.0.0, which pulls in serialize-javascript@7.0.5 (fixed). The remaining serialize-javascript@6.0.2 nested under copy-webpack-plugin is a dev-only build tool with no user-controlled input paths -- accepted as low risk.
  • minimatch CVE (ReDoS via unbounded GLOBSTAR backtracking): Resolved as a side effect of lockfile regeneration -- @microsoft/api-extractor@7.58.6 now pulls in minimatch@10.2.3 (fixed version).

Electron sample restructuring

To keep workspace glob patterns open-ended (matching dev) while avoiding tar@6.x from @electron-forge entering the workspace lockfile, the two electron samples have been moved one level deeper into an electron/ subdirectory:

  • extensions/samples/electron-webpack/ -> extensions/samples/electron/electron-webpack/\n- samples/msal-node-samples/ElectronSystemBrowserTestApp/ -> samples/msal-node-samples/electron/ElectronSystemBrowserTestApp/\n
    The electron/ container directories have no package.json, so they are not picked up by the extensions/samples/* and samples/msal-node-samples/* workspace globs. This keeps the workspace configuration identical to dev with no brittle allowlists. Doc links in 4 files updated to reflect the new paths.

Notes

  • Electron samples are not part of CI and have no E2E pipeline tests.
  • @electron-forge still pulls in tar@6.x transitively and has no upstream fix; the electron samples remain installable standalone but are excluded from the workspace lockfile by directory structure.

Copilot AI review requested due to automatic review settings April 20, 2026 18:31
@hectormmg hectormmg requested a review from a team as a code owner April 20, 2026 18:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the root workspace configuration to mitigate transitive dependency CVEs (notably tar) by excluding certain sample packages from workspaces and forcing a safer tar version via npm overrides.

Changes:

  • Remove extensions/samples/* from root workspaces and replace samples/msal-node-samples/* with an explicit allowlist of node sample workspaces.
  • Add an npm overrides entry to force tar to a non-vulnerable 7.x version.

Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
@hectormmg hectormmg force-pushed the dependency-updates branch from ef952dc to e6e8c1a Compare April 20, 2026 21:02
@hectormmg hectormmg requested a review from a team as a code owner April 20, 2026 21:22
@hectormmg hectormmg changed the title fix: address dependency CVEs (handlebars, hbs, tar, minimatch) fix: address dependency CVEs (handlebars, hbs, tar, serialize-javascript, minimatch) Apr 20, 2026
@hectormmg hectormmg force-pushed the dependency-updates branch 3 times, most recently from 8313d0b to cc7372f Compare April 22, 2026 21:48
@hectormmg hectormmg changed the title fix: address dependency CVEs (handlebars, hbs, tar, serialize-javascript, minimatch) fix: address dependency CVEs (handlebars, hbs, tar, serialize-javascript) Apr 22, 2026
hectormmg and others added 11 commits April 22, 2026 17:21
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… overriding tar to ^7.5.3

- Remove ElectronSystemBrowserTestApp from msal-node-samples workspace glob (explicit list)
- Remove extensions/samples/* wildcard (electron-webpack also used @electron-forge)
- Add overrides.tar = ^7.5.3 to fix remaining tar@6.2.1 via @angular/cli 19 -> pacote chain
  (Angular CLI 19.x will not receive an official fix per angular/angular-cli#32324)
- Regenerate package-lock.json: tar now resolves to 7.5.13

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ipt CVE

Upgrade @rollup/plugin-terser from ^0.4.0 to ^1.0.0 in msal-browser.
v1.0.0 uses serialize-javascript@^7.0.3 (fixed version for RCE via
RegExp.flags/Date.toISOString injection, GHSA-5c6j-r48x-rmvq).

Note: serialize-javascript@6.0.2 remains for copy-webpack-plugin@12.0.2,
which is pinned by @angular-devkit/build-angular. Exploitation is
infeasible there as no user input flows through serialize() in that path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…workspace globs

Move ElectronSystemBrowserTestApp and electron-webpack one level deeper
into an electron/ subdirectory so the open-ended workspace globs
(samples/msal-node-samples/* and extensions/samples/*) can be restored
without including the electron samples in the npm workspace.

Since npm workspaces do not support negation patterns, this structural
change is the cleanest way to exclude specific samples from a glob while
keeping the list open-ended for future additions.

- samples/msal-node-samples/ElectronSystemBrowserTestApp
    -> samples/msal-node-samples/electron/ElectronSystemBrowserTestApp
- extensions/samples/electron-webpack
    -> extensions/samples/electron/electron-webpack

Update all doc links pointing to the old paths.
Regenerate package-lock.json.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Version 1.3.2 does not exist on the npm registry (latest is 1.3.1).
The lockfile was incorrectly resolving to this non-existent version
during regeneration on Node 24. Pin to the existing 1.3.1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The e2e-tests.yml template is pulled from the 1P repo. Hardcoding
ref: dev means CI on this branch never picks up template changes on
dependency-updates. Change to dependency-updates so CI uses the
corrected prewarm script path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Revert .pipelines/1p-e2e.yml 1P resource ref back to dev (temp
  dependency-updates ref was only needed during active branch work)
- Fix changefile comment to use conventional commit prefix and match
  the actual package-level change (@rollup/plugin-terser upgrade)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hectormmg hectormmg force-pushed the dependency-updates branch from cc7372f to 920482f Compare April 23, 2026 00:24
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Attention 👋 Awaiting response from the MSAL.js team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants