Skip to content

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

Closed
sternma wants to merge 2 commits intoenisdenjo:masterfrom
sternma:fix-ws-dos-cve
Closed

fix: upgrade ws to 8.17.1 to fix CVE-2024-37890#591
sternma wants to merge 2 commits intoenisdenjo:masterfrom
sternma:fix-ws-dos-cve

Conversation

@sternma
Copy link
Copy Markdown

@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
Copy Markdown
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 thread jest.config.js
Comment on lines +9 to +11
moduleNameMapper: {
"^ws$": "<rootDir>/node_modules/ws/index.js"
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
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
Copy Markdown
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