Skip to content

Fix CI dependency restores and update vulnerable build dependencies - #5151

Merged
Hannia Valera (hanniavalera) merged 10 commits into
mainfrom
dev/laurenprinn/fix-cg-package-registry
Nov 6, 2026
Merged

Hannia Valera (hanniavalera) merged 10 commits into
mainfrom
dev/laurenprinn/fix-cg-package-registry

Conversation

@laurenprinn

@laurenprinn Lauren Prinn (laurenprinn) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Resolve qs@6.17.1 and source-map-js@1.2.2 through the Azure Artifacts registry configured in .npmrc, preserving those versions and checksums.
  • Raise the existing serialize-javascript override to ^7.1.3 and lock 7.1.3 to address alerts 149 and 201.
  • Raise the existing PostCSS 8 override to ^8.5.23 and lock 8.5.23 to address alerts 144, 161, 162 and 165. Updating only to 8.5.10 would fix alert 144 but leave the other three exposed.
  • Update the directly affected dependency selectors, retain the locked nanoid@3.3.18, picocolors@1.1.1 and source-map-js@1.2.2, and remove the now-unused picocolors@1.0.0 entry.
  • Upgrade only the Mocha and VSCE glob paths to 14.0.3, which natively supports patched minimatch@11.0.3, to address alert 205. Preserve legacy glob@7.2.3 / minimatch@3.1.5 consumers and remove newly unused dependency entries.
  • Select decode-uri-component@0.5.1 for alerts 200 and 172 through a small private CommonJS adapter, preserving both legacy source-map consumers. Run its regression tests as part of the existing yarn backendTests command.
  • No application or localization changes, no registry configuration changes, and no Mocha/Webpack upgrades.

Security alerts addressed

Alert Package Advisory First patched Selected version
144 PostCSS CVE-2026-41305: closing-style-tag XSS 8.5.10 8.5.23
161 PostCSS CVE-2026-45623: arbitrary file reads via sourceMappingURL 8.5.12 8.5.23
162 PostCSS CVE-2026-73646: source-map path traversal 8.5.18 8.5.23
165 PostCSS CVE-2026-69153: source-map reads when from is unset 8.5.23 8.5.23
149 serialize-javascript CVE-2026-34043: CPU exhaustion on array-like objects 7.0.5 7.1.3
201 serialize-javascript CVE-2026-115897: terminal closing-script-tag escaping 7.1.3 7.1.3
205 minimatch CVE-2026-118764: preprocessing amplification 11.0.1 11.0.3
200 decode-uri-component CVE-2026-118664: quadratic replacement of distinct encoded runs 0.5.1 0.5.1
172 decode-uri-component CVE-2026-45822: exponential malformed-input decoding 0.5.0 0.5.1

Why

Build 15941073 fails because two lockfile tarball URLs bypass the approved feed and reach the public npm registry blocked by the build proxy (HTTP 403).

Dependabot run 42053808453 separately reports security_update_not_possible: Mocha 10.8.2 (via gulp-mocha), Mocha 11.7.5 and terser-webpack-plugin 5.3.16 (via Webpack) request serialize-javascript@^6.0.2. It reports 7.0.4 as latest resolvable and 7.1.3 as earliest fixed; the log also shows 404s for the feed's version-specific metadata endpoints. The existing project overrides already select serializer major 7 and PostCSS major 8; this raises their minimums and refreshes the lockfile without upgrading unrelated tooling.

Dependency compatibility

  • Forcing minimatch 11 into glob 8/10/11 broke actual file discovery, so this PR upgrades the affected parent glob paths instead. The direct Mocha minimatch override remains unchanged. Remove the broad brace-expansion override that would force incompatible major 1 into nested modern minimatch; legacy minimatch 3 retains brace-expansion 1.1.21.
  • Decoder 0.5.1 is ESM-only, while source-map-resolve 0.5.3 and 0.6.0 synchronously require a callable CommonJS export. The private adapter exposes the patched decoder's default export without copying its implementation. It requires Node ^20.19.0 || >=22.12.0; repository CI already uses Node 22. It is development-only and is excluded from VSIX packaging by the existing tools/ exclusion. The VS Code runtime requirement is unchanged.

Required feed prerequisite

A cpp_PublicPackages feed collaborator/owner must ensure qs@6.17.1, glob@14.0.3, path-scurry@3.0.0, and decode-uri-component@0.5.1 are saved from the npm upstream and readable by the build identity. Available anonymous archive requests returned HTTP 401; authenticated checks for the new glob and decoder archives returned 404. The latest full frozen restore fails fetching path-scurry@3.0.0 with HTTP 401. The source-map-js@1.2.2, postcss@8.5.23, and serialize-javascript@7.1.3 archives download successfully from the configured feed. This PR alone does not confirm the pipeline is fixed.

Validation

  • Yarn's own offline resolver successfully resolves the complete final repository dependency graph. Its minimatch versions are now only 3.1.5 and 11.0.3; both decoder package/alias entries select 0.5.1.
  • The two committed CommonJS-adapter tests pass on Node 22.23.4, covering normal decoding, malformed input, invalid argument errors, and bounded decoding of long malformed input and distinct encoded runs in a timeout-protected child process. The existing backend-test command runs these checks before the Mocha suites.
  • Reproduced minimatch preprocessing amplification with optimizationLevel 2 and braceExpandMax 4: 10.2.4 generated eight patterns, while 11.0.3 caps the same input at four.
  • Verified real Mocha 10 and 11 file discovery, glob 14 synchronous/iterator APIs, preserved glob 7 matching, and both actual source-map-resolve versions with encoded spaces, literal plus signs, and malformed escapes.
  • Source-validation limitation: the new glob/path-scurry/decoder npm archives were unavailable. Those compatibility checks used isolated fixtures built from official release-tag source checkouts: glob v14.0.3 (fc93fd5), path-scurry v3.0.0 (31124d9), and decoder v0.5.1 (58ed85f). The VSCE dependency-path check used a small dependency capsule, not a full VSCE packaging run. Registry metadata/integrities are recorded in the lockfile, but this is not verification of the unavailable npm archive contents or a successful full repository build.
  • git diff --check passes. All PostCSS selectors share 8.5.23, all serializer selectors share 7.1.3, and no direct public npm tarball URLs remain in yarn.lock.
  • Installed PostCSS 8.5.23 and serializer 7.1.3 from the configured feed using Yarn 1.22.22. The PostCSS lock entry, including dependency ranges and integrity, matches Yarn-generated metadata.
  • Reproduced all four PostCSS defects on 8.4.38 using inert CSS and synthetic fixture files only. Confirmed 8.5.23 escapes closing-style tags (including uppercase and comments) and performs no reads of the synthetic non-map target, traversed-to .map, or absolute .map with from unset.
  • Confirmed legitimate same-directory source maps and explicitly trusted map.prev callbacks still load. Verified the real @gulp-sourcemaps/identity-map@2.0.1 consumer preserves CSS and generates correct source-map positions with PostCSS 8.5.23 and the locked source-map-js@1.2.2.
  • Prior serializer checks reproduced the terminal closing-script-tag defect and bounded array-like iteration on 7.0.4; 7.1.3 fixes both while preserving normal data/function/array serialization.
  • Retried frozen repository restore with the final lockfile: dependency resolution succeeds, but downloading path-scurry@3.0.0 fails (HTTP 401), so full repository build/lint/test checks remain blocked. Resolve feed access/caching, then rerun CMake Tools CG [Yaml] and normal build/test checks on this branch. After merge, rerun Dependabot/CG scans to confirm alert closure.
Resolve qs and source-map-js through the configured Azure Artifacts feed without changing package versions or integrity hashes.

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

Copilot-Session: 93ca34e1-42aa-4082-8c31-20eb605a6d28
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
Lauren Prinn and others added 2 commits November 5, 2026 15:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 93ca34e1-42aa-4082-8c31-20eb605a6d28
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93ca34e1-42aa-4082-8c31-20eb605a6d28
@laurenprinn Lauren Prinn (laurenprinn) changed the title Fix dependency restore URLs for isolated CI builds Nov 5, 2026
Lauren Prinn and others added 2 commits November 5, 2026 15:25
Record that the serializer upgrade also addresses Dependabot alert 149 (CVE-2026-34043).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93ca34e1-42aa-4082-8c31-20eb605a6d28
Raise the existing PostCSS 8 override to 8.5.23 and refresh its lockfile dependencies to address alerts 144, 161, 162 and 165.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93ca34e1-42aa-4082-8c31-20eb605a6d28
@laurenprinn Lauren Prinn (laurenprinn) changed the title Fix CI dependency restores and update vulnerable serializer Nov 5, 2026
Lauren Prinn and others added 2 commits November 5, 2026 16:04
Upgrade the Mocha and VSCE glob dependency paths to support patched minimatch without breaking file discovery. Adapt the patched ESM URI decoder for legacy CommonJS source-map consumers and run its regression checks with backend tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93ca34e1-42aa-4082-8c31-20eb605a6d28
Copilot AI and others added 2 commits November 6, 2026 00:19
Co-authored-by: laurenprinn <44309659+laurenprinn@users.noreply.github.com>
Co-authored-by: laurenprinn <44309659+laurenprinn@users.noreply.github.com>
Remove public-registry rewrites from CI and Copilot setup, and report feed failures without assuming throttling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hanniavalera
Hannia Valera (hanniavalera) marked this pull request as ready for review November 6, 2026 16:50
@hanniavalera
Hannia Valera (hanniavalera) merged commit 7686a7d into main Nov 6, 2026
37 of 40 checks passed
@hanniavalera
Hannia Valera (hanniavalera) deleted the dev/laurenprinn/fix-cg-package-registry branch November 6, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants