Skip to content

chore: fix dependency vulnerabilities (S360 + Dependabot + npm audit) - #1433

Merged
Jayanth Reddy Bujula (jbujula) merged 3 commits into
mainfrom
users/jbujula/security-jsdiff-ghsa-73rr-hh4g-fpgx
Aug 13, 2026
Merged

Jayanth Reddy Bujula (jbujula) merged 3 commits into
mainfrom
users/jbujula/security-jsdiff-ghsa-73rr-hh4g-fpgx

Conversation

@jbujula

@jbujula Jayanth Reddy Bujula (jbujula) commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes all actionable open security alerts across S360/Component Governance (ADO), GitHub Dependabot, and npm audit.

Originally scoped to GHSA-73rr-hh4g-fpgx (jsdiff); expanded to cover the full open alert set.

Dependencies updated

Package Before After Reason
diff (jsdiff) ^5.2.0 ^8.0.3 GHSA-73rr-hh4g-fpgx / CVE-2026-24001 (S360 6587258)
tar ^7.5.16 ^7.5.22 CriticalGHSA-w8wr-v893-vjvp, GHSA-23hp-3jrh-7fpw, GHSA-8x88-c5mf-7j5w, GHSA-gvwx-54wh-qm9j, GHSA-r292-9mhp-454m
postcss ^8.5.15 ^8.5.25 High — GHSA-r28c-9q8g-f849, GHSA-fxqj-rqcc-2cmp
ip-address ^10.2.0 ^10.3.1 High — GHSA-mwp4-54f8-5fhr, GHSA-4xrf-jv44-h6hh, GHSA-22jq-vg5j-6vgg
adm-zip ^0.5.16 ^0.6.0 High — GHSA-xcpc-8h2w-3j85
js-yaml ^4.2.0 ^4.3.0 High — GHSA-52cp-r559-cp3m / CVE-2025-64718 (S360 6587259)
undici ^6.24.0 ^6.28.0 Moderate — GHSA-8xcm-r25x-g524, GHSA-m8rv-5g2x-5cg5, GHSA-v3r7-h72x-cjcm
brace-expansion (v5) ^5.0.6 ^5.0.8 High — GHSA-3jxr-9vmj-r5cp, GHSA-mh99-v99m-4gvg (S360 6587257, 6587260)
brace-expansion (v2) ^2.0.3 ^2.1.3 High — same advisories, v2 line (S360 6587261)
brace-expansion (v1) 1.1.15 1.1.17 High — same advisories, v1 line (lock-file patch)

Note on the lock-file patch

Two brace-expansion copies are inBundle: true (bundled inside @microsoft/powerplatform-cli-wrapper, and under minimatch), so npm overrides cannot reach them. They are patched directly in package-lock.json with the correct version / resolved / integrity. npm ci re-installs cleanly against the patched lock, confirming the integrity hashes are valid.

Known limitations / follow-ups

  • brace-expansion GHSA-rgw5-rvv9-x895not fixable from this branch, but not unfixable in general. Correction to an earlier note on this PR: the patched versions (1.1.18 / 2.1.4 / 5.0.9) are published on the public npm registry — Dependabot has already opened Bump brace-expansion from 2.0.3 to 2.1.4 #1437 for 2.1.4. They could not be applied here because this machine resolves through the 1ES feed mirror (ms-feed-*.pkgs.visualstudio.com), which still tops out at 1.1.17 / 2.1.3 / 5.0.8, so npm install cannot fetch them. Land the Dependabot PRs after this one to close it out. Every remaining high entry in npm audit is a transitive path to this single advisory; the raw count is inflated by path enumeration, not by new risk.
  • elliptic GHSA-848j-6mx2-7j84 — permanent accepted risk. Dev-only (rewiremock -> node-libs-browser -> crypto-browserify), no patched version exists.
  • Unmapped S360 items — a large batch of [S360] work items (CVE-2026-13149, CVE-2026-14257, CVE-2026-27903/27904, CVE-2026-59869, GHSA-5c6j-r48x-rmvq) carry only a Component Governance alertId with no package or version in the description, so they could not be mapped to a dependency programmatically. CVE-2026-14257 is the brace-expansion DoS and is addressed here; the rest need to be resolved against the CG portal manually.

Test plan

  • npm install clean
  • npm ci clean against the patched lock file
  • npm audit — no new vulnerabilities introduced; all fixable advisories resolved
  • npm run cicompile and lint pass
  • Functional tests — exempt (require PA_BT_ORG_PASSWORD)

Unit tests fail locally with a pre-existing ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX error under Node v24.14.1. Verified this reproduces on the unmodified dependency tree (git stash + npm ci + npm test), so it is not caused by this change.

🤖 Generated with GitHub Copilot CLI

Resolves the S360 SDL action item 6014425 (jsdiff parsePatch DoS/ReDoS,
GHSA-73rr-hh4g-fpgx), patched in jsdiff 8.0.3. Lockfile resolves to 8.0.4.
Build passes; local mocha suite is blocked by a pre-existing Node 24
TypeScript-loader issue present on origin/main, unrelated to this change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: de0407b8-fb71-416c-8f0c-d03c0a7e0ef7
Fixed:
- tar        ^7.5.16 -> ^7.5.22  (critical: GHSA-w8wr-v893-vjvp, GHSA-23hp-3jrh-7fpw, GHSA-8x88-c5mf-7j5w, GHSA-gvwx-54wh-qm9j, GHSA-r292-9mhp-454m)
- postcss    ^8.5.15 -> ^8.5.25  (high: GHSA-r28c-9q8g-f849, GHSA-fxqj-rqcc-2cmp)
- ip-address ^10.2.0 -> ^10.3.1  (high: GHSA-mwp4-54f8-5fhr, GHSA-4xrf-jv44-h6hh, GHSA-22jq-vg5j-6vgg)
- js-yaml    ^4.2.0  -> ^4.3.0   (high: GHSA-52cp-r559-cp3m / CVE-2025-64718, S360 6587259)
- adm-zip    ^0.5.16 -> ^0.6.0   (high: GHSA-xcpc-8h2w-3j85)
- undici     ^6.24.0 -> ^6.28.0  (moderate: GHSA-8xcm-r25x-g524, GHSA-m8rv-5g2x-5cg5, GHSA-v3r7-h72x-cjcm)
- brace-expansion v5 ^5.0.6 -> ^5.0.8, v2 ^2.0.3 -> ^2.1.3, v1 1.1.15 -> 1.1.17
  (high: GHSA-3jxr-9vmj-r5cp, GHSA-mh99-v99m-4gvg; S360 6587257/6587260/6587261)

The two bundled brace-expansion copies (under @microsoft/powerplatform-cli-wrapper
and minimatch) are inBundle and cannot be reached by npm overrides, so they are
patched directly in package-lock.json.

Accepted risk (no published fix):
- brace-expansion GHSA-rgw5-rvv9-x895 - patched version 5.0.9 is not published;
  5.0.8 is the latest available. Remaining "high" audit entries are all transitive
  paths to this single advisory.
- elliptic GHSA-848j-6mx2-7j84 - dev-only, no patched version (permanent accepted risk).

Verified: npm run ci -> compile + lint pass. Unit tests fail locally with a
pre-existing ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX error under Node v24 that reproduces
on the unmodified dependency tree; not caused by this change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6ac571cd-d84e-4b40-805a-e316a62ed292
@jbujula Jayanth Reddy Bujula (jbujula) changed the title Fix GHSA-73rr-hh4g-fpgx: bump diff (jsdiff) ^5.2.0 -> ^8.0.3 chore: fix dependency vulnerabilities (S360 + Dependabot + npm audit) Aug 5, 2026
@jbujula
Jayanth Reddy Bujula (jbujula) requested a review from a team August 6, 2026 01:03
@jbujula

Copy link
Copy Markdown
Collaborator Author

Two things reviewers should know before merging

1. CI is red repo-wide, and it is not this PR.

build (ubuntu-latest) fails at npm ci with:

npm error code E401
npm error 401 Unauthorized - GET https://npm.pkg.github.com/download/@microsoft/powerplatform-cli-wrapper/0.1.135/...
  unauthenticated: User cannot be authenticated with the token provided.

The GPR_ACCESS_TOKEN secret appears to have expired. The identical ubuntu failure / windows cancelled pattern is present on unrelated PRs from other authors — #1431 (28 Jul) and #1425 (18 Jul) — and the last green run on main was 29 Jul. Someone with repo admin needs to rotate GPR_ACCESS_TOKEN before any PR here can go green.

Local verification stands in for CI in the meantime: npm ci clean against the patched lock, and npm run ci compiles and lints.

2. Overlap with open Dependabot PRs.

These were opened independently and overlap with this PR:

PR Package Status vs. this PR
#1425 adm-zip 0.6.0 superseded — already here
#1436 ip-address 10.4.0 superseded — this PR pins ^10.3.1, which resolves to 10.4.x
#1439 undici 6.28.0 superseded — already here
#1437 brace-expansion 2.1.4 still needed — closes GHSA-rgw5-rvv9-x895, which this PR could not reach

Suggested order: merge this PR, then #1437 (and let Dependabot rebase or close the other three).

@jbujula

Copy link
Copy Markdown
Collaborator Author

Update: CI is green. GPR_ACCESS_TOKEN has been rotated and I re-ran the builds — build (ubuntu-latest) and build (windows-latest) both pass on all three PRs (#1433, #1440, #1441). The 401 from GitHub Packages described above is resolved; that blocker no longer applies.

The overlap guidance in the previous comment still stands: #1425 / #1436 / #1439 are superseded by this PR, and #1437 is still needed to close GHSA-rgw5-rvv9-x895.

The 1ES feed mirror has caught up, so versions that were unreachable last week are
now installable. This closes the advisories that were previously left open.

  brace-expansion  2.1.3 -> 2.1.4, 5.0.8 -> 5.0.9, 1.1.17 -> 1.1.18
    closes GHSA-rgw5-rvv9-x895 (CVE-2026-69152), previously recorded as unfixable
  js-yaml          4.3.0 -> 4.3.1   closes GHSA-5p4m-2wfm-xmqj
  nanoid           3.3.11 -> 3.3.17 closes GHSA-2v37-7h3g-55p8 and GHSA-28wg-ghj8-5hjv
    the override pinned nanoid to an exact 3.3.11, which was blocking the fix

postcss stays at 8.5.25, which already exceeds the highest patched version (8.5.23).

npm audit high/moderate/critical count is now zero; the 6 remaining low findings are
the documented dev-only elliptic/rewiremock accepted risk.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6ac571cd-d84e-4b40-805a-e316a62ed292
@jbujula

Copy link
Copy Markdown
Collaborator Author

Update: the remaining advisories are now closed, and the wrapper's own repo is the real root cause

1. GHSA-rgw5-rvv9-x895 is fixed after all

I previously recorded this as unfixable. That was wrong — it was feed-mirror lag, not a missing upstream fix. The 1ES mirror has since caught up, so 372f2a4 takes the fully-patched versions:

Package Before After Closes
brace-expansion 2.1.3 / 5.0.8 / 1.1.17 2.1.4 / 5.0.9 / 1.1.18 GHSA-rgw5-rvv9-x895 (CVE-2026-69152)
js-yaml 4.3.0 4.3.1 GHSA-5p4m-2wfm-xmqj
nanoid 3.3.11 3.3.17 GHSA-2v37-7h3g-55p8, GHSA-28wg-ghj8-5hjv

nanoid is worth calling out: the overrides block pinned it to an exact 3.3.11, which was silently blocking the patch. It is now ^3.3.17.

postcss stays at 8.5.25 — already above the highest patched version (8.5.23). It still shows in npm audit with an empty range, which is the path-enumeration noise noted earlier, not a real exposure.

npm audit high/moderate/critical is now zero (was 1 critical + 6 high). The 6 remaining low findings are the documented dev-only elliptic / rewiremock accepted risk, which needs a semver-major rewiremock bump.

2. The glob/node_modules/brace-expansion alert cannot be fixed from this repo

S360 reports that path against two pipelines, and they are two different repositories:

Pipeline Repo Status
PowerPlatform-DPX-Tools-GitHub-BT-Official this repo Fix detected (Jun 22)
PowerPlatform-DPX-Tools-GitHub-CLI-Wrapper-Official microsoft/powerplatform-cli-wrapper Fix not detected

The wrapper's own main lock had node_modules/glob/node_modules/brace-expansion at 5.0.4 — below the 5.0.5 required by CVE-2026-33750. No change in this repo can fix that, because it lives in the wrapper's source tree.

I've opened microsoft/powerplatform-cli-wrapper#506 to fix it there (5.0.4 → 5.0.9, verified on disk, 74 tests passing).

⚠️ One honest caveat about this repo: the two inBundle lock entries are metadata-only patches. The wrapper ships its own node_modules inside the published tarball, so the physical bundled file stays at whatever @microsoft/powerplatform-cli-wrapper@0.1.135 was published with (5.0.6) regardless of what our lock says. The durable fix is #506 landing and a new wrapper version being published and consumed here.

Verification

  • npm ci clean against the patched lock
  • npm run cicompile and lint pass
  • unitTest fails with ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX on Node v24 — pre-existing, proven earlier by reproducing it on an unmodified tree

@jbujula

Copy link
Copy Markdown
Collaborator Author

Heads-up: one new advisory landed after this PR was verified

GHSA-2v37-7h3g-55p8 (high) was published against nanoid < 3.3.18 - after this branch was audited clean. It also cascades to postcss, which npm audit flags purely via nanoid ("via": ["nanoid"]), not on its own.

No change is needed in this PR. The override here is already a caret range:

"nanoid": "^3.3.17"

which permits 3.3.18 - so this needs only a lockfile refresh, not a version bump.

Why it is not refreshed here yet: nanoid@3.3.18 is released upstream (tagged in ai/nanoid) but has not reached the internal feed proxy:

$ npm view nanoid@3.3.18 version
npm error code E404
npm error 404  'nanoid@3.3.18' is not in this registry.   (registry: https://packagefeedproxy.microsoft.io/npm/)

Pinning ^3.3.18 today would fail npm ci outright, so it is deliberately left alone.

This is precisely the recurring-alert pattern the automation in the companion PR is meant to absorb: its weekly npm update will pick up 3.3.18 on its own once the mirror syncs, with no human change. Until then it is a known, tracked gap rather than a silent one.

@jbujula
Jayanth Reddy Bujula (jbujula) merged commit ee560c3 into main Aug 13, 2026
5 checks passed
@jbujula
Jayanth Reddy Bujula (jbujula) deleted the users/jbujula/security-jsdiff-ghsa-73rr-hh4g-fpgx branch August 13, 2026 22:16
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