Skip to content

Conversation

@hlovdal
Copy link

@hlovdal hlovdal commented Jan 15, 2026

The sinon package is really old and depends on a version of mocha that depends on a vulnerable version of diff. The diff package has been updated to fix this, but mocha has not made a new release yet.

Eventually mocha will, and sinon should also eventually update to use that version, but until then there is no reason to wait to update sinon to the latest version in the mean time. I read though the changelog and found no issues. I updated the package in multiple intermediate steps and none of them had any problems. Let me know if you rather want to have them squashes into just one commit that updates directly to the latest version.

Instead of passively waiting for new releases of mocha and sinon, it is possible to override directly and the last commit does exactly that so that then npm audit reports no issues with this repository.

If you want to have any changes to the branch, let me know and I'll update it.

npm install --save-dev node-red

Without this a fresh clone fails running the example tests:

$ npm run examples

> [email protected] examples
> mocha "examples/**/*_spec.js"

 Exception during run: Error: Cannot find module 'node-red'
Require stack:
- /.../src/github/node-red-node-test-helper/examples/comment_spec.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1383:15)
    at Function.resolve (node:internal/modules/helpers:157:19)
    at Object.<anonymous> (/.../src/github/node-red-node-test-helper/examples/comment_spec.js:19:21)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Module._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at cjsLoader (node:internal/modules/esm/translators:309:5)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:345:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async formattedImport (/.../src/github/node-red-node-test-helper/node_modules/mocha/lib/nodejs/esm-utils.js:10:14)
    at async Object.requireModule [as requireOrImport] (/.../src/github/node-red-node-test-helper/node_modules/mocha/lib/nodejs/esm-utils.js:102:30)
    at async exports.loadFilesAsync (/.../src/github/node-red-node-test-helper/node_modules/mocha/lib/nodejs/esm-utils.js:152:20)
    at async singleRun (/.../src/github/node-red-node-test-helper/node_modules/mocha/lib/cli/run-helpers.js:168:3)
    at async exports.handler (/.../src/github/node-red-node-test-helper/node_modules/mocha/lib/cli/run.js:379:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/.../src/github/node-red-node-test-helper/examples/comment_spec.js'
  ]
}

$
While waiting for upstream project to update its dependency,
mochajs/mocha#5632

Fixes GHSA-73rr-hh4g-fpgx.
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.

1 participant