awslabs / aws-crt-nodejs

NodeJS bindings for the AWS Common Runtime.
Apache License 2.0
37 stars 24 forks source link

Force update ansi-regex to fix reports of build time vulnerability #458

Closed TwistedTwigleg closed 1 year ago

TwistedTwigleg commented 1 year ago

Description of changes:

Adds ansi-regex version ^3.0.1 to the package.json to fix reported security vulnerabilities in cmake-js.

This has been reported in https://github.com/aws/aws-iot-device-sdk-js-v2/issues/286, and as noted there it is due to cmake-js, which we are using the latest 6.X version of. However, as noted in https://github.com/cmake-js/cmake-js/issues/292 on the cmake-js repository, to fix this issue in cmake-js 6.X that would required updating from yargs 3.X to 13.X, which is roughly 3 years of changes in yargs and currently appears not to be an effort in motion because of the large impact it could have.

It should be noted that this ansi-regex issue only impacts cmake-js and does not have any impact at runtime or for built projects. It is purely a build-time issue, as that is the only place we're using cmake-js and we control all the input to it.

This PR fixes the issue by pinning ansi-regex to version ^3.0.1, which fixes the vulnerability by forcing the use of a newer version of ansi-regex than what cmake-js 6.X uses. This was tested with Node 10.13 and found to work without any issues.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.