Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[security risk] dependency cli-color depends on es5-ext #1253

Closed
Roozenboom opened this issue Nov 21, 2024 · 3 comments · Fixed by #1254
Closed

[security risk] dependency cli-color depends on es5-ext #1253

Roozenboom opened this issue Nov 21, 2024 · 3 comments · Fixed by #1254
Labels
bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer

Comments

@Roozenboom
Copy link
Contributor

As a big enterprise organisation we continuously scanning our dependencies for vulnerabilities and other security risks.
One of the dependencies of @pact-foundation/pact is 'cli-color' (https://github.com/medikoo/cli-color), this package by itself has not security risk, but it depends on 'es5-ext' (https://github.com/medikoo/es5-ext) that is marked as malicious by sonatype (sonatype-2022-2248) as it contains malware/protestware in a postinstall script since 2022.

The question is can this be replaced by an alternative package?

There are many alternatives that can do console coloring as well, probably the best known one is chalk: https://www.npmjs.com/package/chalk (see npm trends: https://npmtrends.com/chalk-vs-cli-color)
And @pact-foundation/pact only uses cli-color once to show a console error in red:

console.error(clc.red('Pact verification failed!'));

@Roozenboom Roozenboom added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Nov 21, 2024
@YOU54F
Copy link
Member

YOU54F commented Nov 21, 2024

Sonatypes rationale of it being unexpected to the end user is fair, as it isn't documented in the readme, and a user would have to go and read issue threads, probably after the fact.

We already use chalk in the pact-js-cli project, so I am happy with that being replaced.

https://github.com/pact-foundation/pact-js-cli/blob/8af58511517558fa3449eaa4c6dcd2177820e079/package.json#L62

would you be open to proposing a pull request?

@YOU54F
Copy link
Member

YOU54F commented Nov 21, 2024

Released

https://github.com/pact-foundation/pact-js/releases/tag/v13.2.0

@mefellows
Copy link
Member

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants