Skip to content

fix: remediate mocha CVEs by upgrading to mocha 10.x - #3080

Open
rayhanest wants to merge 2 commits into
grpc:masterfrom
Nordix:fix/cve-remediate-mocha
Open

rayhanest wants to merge 2 commits into
grpc:masterfrom
Nordix:fix/cve-remediate-mocha

Conversation

@rayhanest

Copy link
Copy Markdown

Summary

Upgrades the mocha test toolchain to clear 7 dev-dependency CVEs. No production dependencies affected.

  • gulp-mocha 4.3.1 → 9.0.0
  • mocha ^3.5.3 → ^10.8.2
  • mocha-jenkins-reporter ^0.3.9 → ^0.4.8
  • @types/gulp-mocha 0.0.31 → 0.0.37
  • Added overrides for serialize-javascript (^7.0.5) and diff (^4.0.4)

Advisories resolved

Advisory Severity Package
GHSA-qh2h-chj9-jffq Critical growl (removed)
GHSA-xvch-5gv4-984h Critical minimist (removed)
GHSA-vh95-rmgr-6w4m Moderate minimist (removed)
GHSA-5c6j-r48x-rmvq High serialize-javascript
GHSA-qj8w-gfj5-8c6v Moderate serialize-javascript
GHSA-9vvw-cc9w-f27h High debug
GHSA-gxpj-cx7g-858c Low debug
GHSA-73rr-hh4g-fpgx Low diff (mocha-jenkins-reporter)

Upgrade gulp-mocha 4.3.1 → 9.0.0, mocha ^3.5.3 → ^10.8.2,
mocha-jenkins-reporter ^0.3.9 → ^0.4.8, @types/gulp-mocha → 0.0.37.

Add overrides for serialize-javascript (^7.0.5) and diff (^4.0.4)
to patch transitive CVEs that mocha 10 and mocha-jenkins-reporter
pin below fixed versions.

Resolves: CVE-2017-16042 (growl, critical)
Resolves: CVE-2017-20165, CVE-2017-16137 (debug, high/low)
Resolves: GHSA-h6ch-v84p-w6p9, CVE-2026-24001 (diff, high/low)
Resolves: CVE-2021-44906 (minimist, critical)
Resolves: GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v (serialize-javascript, high)

Total dev vulnerabilities: 61 → 54. No production dependencies affected.
No code changes to gulpfiles — gulp-mocha API is unchanged.
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 11, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: rayhanest / name: rayhanest (f7eb8e6)

mocha 3 exited automatically when tests finished. mocha 4+ waits for
the event loop to drain, so a test that leaks a handle (an open socket,
a timer, a server still listening) keeps the process alive.

After the mocha 3 -> 10 upgrade in the previous commit, this caused the
Kokoro CI job to run until the 3600s VM wall-clock cap and get killed
with exit 1, even though every test suite passed.

Add a root .mocharc.js with exit: true to restore the mocha 3 behavior.
mocha searches upward for the nearest rc file, so this single config
applies to every package's gulp test task. Only exit is set, so the
mocha-jenkins-reporter config in the gulpfiles is untouched.
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.

3 participants