Skip to content

fix: upgrade ws to 8.17.1 to fix CVE-2024-37890 #591

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

Closed
wants to merge 2 commits into from

Conversation

sternma
Copy link

@sternma sternma commented Nov 8, 2024

This PR upgrades the ws dependency from version 8.12.0 to 8.17.1 to address the security vulnerability described in CVE-2024-37890.

Changes Made:

  • package.json
    • Updated ws version to 8.17.1.
  • jest.config.js
    • Added moduleNameMapper to resolve module resolution issues during testing. These stemmed from ws introducing a browser.js export in their package.json in 18.12.1.

Reason for Change:

  • The current version 8.12.0 of ws has a known vulnerability (GHSA-3h5v-q93c-6h6q).
  • Upgrading to ^8.17.1 resolves this issue.

Testing Done:

  • All unit tests pass.

References:

Please review and let me know if any further changes are needed.

Copy link
Owner

@enisdenjo enisdenjo left a comment

Choose a reason for hiding this comment

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

ws is an optional peer dependency, there's no security issues the library itself (library is also zero-dependency).

Comment on lines +9 to +11
moduleNameMapper: {
"^ws$": "<rootDir>/node_modules/ws/index.js"
}
Copy link
Owner

Choose a reason for hiding this comment

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

Why?

Copy link
Owner

Choose a reason for hiding this comment

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

Added moduleNameMapper to resolve module resolution issues during testing. These stemmed from ws introducing a browser.js export in their package.json in 18.12.1.

Ah ok, but I wonder if there's another way to solve this.

@enisdenjo
Copy link
Owner

Can you please fix the linting issues so we can merge?

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.

2 participants