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

fix: security vulnerabilities #78

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

magicmatatjahu
Copy link
Member

@magicmatatjahu magicmatatjahu commented Jan 7, 2022

Description

Fix security vulnerabilities:

  • move mocha package to the devDependencies
  • update packages to fix security vulnerabilities. Some vulnerabilities are still (only moderate, not high), even after several npm run audit:
# npm audit report

ansi-regex  >2.1.1 <5.0.1
Severity: moderate
 Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
fix available via `npm audit fix`
node_modules/npm/node_modules/cli-table3/node_modules/ansi-regex
node_modules/npm/node_modules/string-width/node_modules/ansi-regex
  strip-ansi  4.0.0 - 5.2.0
  Depends on vulnerable versions of ansi-regex
  node_modules/npm/node_modules/string-width/node_modules/strip-ansi
    string-width  2.1.0 - 4.1.0
    Depends on vulnerable versions of strip-ansi
    node_modules/npm/node_modules/string-width

json-schema  <0.4.0
Severity: moderate
json-schema is vulnerable to Prototype Pollution - https://github.com/advisories/GHSA-896r-f27r-55mw
fix available via `npm audit fix`
node_modules/npm/node_modules/json-schema
  jsprim  0.3.0 - 1.4.1 || 2.0.0 - 2.0.1
  Depends on vulnerable versions of json-schema
  node_modules/npm/node_modules/jsprim

5 moderate severity vulnerabilities

Also update default version to convert from 2.1.0 to 2.2.0.

Related issue(s)
Resolves #77

cli.js Outdated
@@ -32,7 +32,7 @@ if (!asyncapiFile) {
program.help(); // This exits the process
}
if (!version) {
version = '2.1.0';
version = '2.2.0';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to fixing security vulnerabilities? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No but while testing cli I noticed that without specifying the version it converts the spec to 2.1.0 and not to the latest version 2.2.0. We overlooked this in the previous release :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok. I'd say you should be opening another PR for that change but I'm not going to block you for that. Just please take this into account for future PRs. If we had to revert this PR for some reason, we could forget about keeping this change that's not related to the purpose of the PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I will open another PR with that. Could you accept again? :) Thanks!

fmvilas
fmvilas previously approved these changes Jan 7, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@magicmatatjahu magicmatatjahu requested a review from fmvilas January 7, 2022 11:29
@magicmatatjahu magicmatatjahu added the dependencies Pull requests that update a dependency file label Jan 7, 2022
@magicmatatjahu magicmatatjahu merged commit 65e2888 into asyncapi:master Jan 10, 2022
@magicmatatjahu magicmatatjahu deleted the fix-security-vulns branch January 10, 2022 09:09
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Secutirty] Vulnerability in Mocha.js
3 participants