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

Update dependency socket.io to v2 [SECURITY] #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Apr 26, 2021

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
socket.io ^1.3.5 -> ^2.5.1 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2020-28481

The package socket.io before 2.4.0 are vulnerable to Insecure Defaults due to CORS Misconfiguration. All domains are whitelisted by default.

CVE-2024-38355

Impact

A specially crafted Socket.IO packet can trigger an uncaught exception on the Socket.IO server, thus killing the Node.js process.

node:events:502
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. (undefined)
    at new NodeError (node:internal/errors:405:5)
    at Socket.emit (node:events:500:17)
    at /myapp/node_modules/socket.io/lib/socket.js:531:14
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  code: 'ERR_UNHANDLED_ERROR',
  context: undefined
}

Affected versions

Version range Needs minor update?
4.6.2...latest Nothing to do
3.0.0...4.6.1 Please upgrade to socket.io@4.6.2 (at least)
2.3.0...2.5.0 Please upgrade to socket.io@2.5.1

Patches

This issue is fixed by socketio/socket.io@15af22f, included in socket.io@4.6.2 (released in May 2023).

The fix was backported in the 2.x branch today: socketio/socket.io@d30630b

Workarounds

As a workaround for the affected versions of the socket.io package, you can attach a listener for the "error" event:

io.on("connection", (socket) => {
  socket.on("error", () => {
    // ...
  });
});

For more information

If you have any questions or comments about this advisory:

  • Open a discussion here

Thanks a lot to Paul Taylor for the responsible disclosure.

References


Release Notes

socketio/socket.io (socket.io)

v2.5.1

Compare Source

Bug Fixes
  • add a noop handler for the error event (d30630b)
Links:

v2.5.0

Compare Source

⚠️ WARNING ⚠️

The default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service.

Security advisory: GHSA-j4f2-536g-r55m

Bug Fixes
  • fix race condition in dynamic namespaces (05e1278)
  • ignore packet received after disconnection (22d4bdf)
  • only set 'connected' to true after middleware execution (226cc16)
  • prevent the socket from joining a room after disconnection (f223178)
Links:

v2.4.1

Compare Source

Reverts
  • fix(security): do not allow all origins by default (a169050)

v2.4.0

Compare Source

Related blog post: https://socket.io/blog/socket-io-2-4-0/

Features (from Engine.IO)
  • add support for all cookie options (19cc582)
  • disable perMessageDeflate by default (5ad2736)
Bug Fixes
  • security: do not allow all origins by default (f78a575)
  • properly overwrite the query sent in the handshake (d33a619)

⚠️ BREAKING CHANGE ⚠️

Previously, CORS was enabled by default, which meant that a Socket.IO server sent the necessary CORS headers (Access-Control-Allow-xxx) to any domain. This will not be the case anymore, and you now have to explicitly enable it.

Please note that you are not impacted if:

  • you are using Socket.IO v2 and the origins option to restrict the list of allowed domains
  • you are using Socket.IO v3 (disabled by default)

This commit also removes the support for '*' matchers and protocol-less URL:

io.origins('https://example.com:443'); => io.origins(['https://example.com']);
io.origins('localhost:3000');          => io.origins(['http://localhost:3000']);
io.origins('http://localhost:*');      => io.origins(['http://localhost:3000']);
io.origins('*:3000');                  => io.origins(['http://localhost:3000']);

To restore the previous behavior (please use with caution):

io.origins((_, callback) => {
  callback(null, true);
});

See also:

Thanks a lot to @​ni8walk3r for the security report.

Links:

v2.3.0

Compare Source

This release mainly contains a bump of the engine.io and ws packages, but no additional features.

Links:

v2.2.0

Compare Source

Features

  • add cache-control header when serving the client source (#​2907)

Bug fixes

  • throw an error when trying to access the clients of a dynamic namespace (#​3355)
Links

v2.1.1

Compare Source

Features

socket.local.to('room101').emit(/* */);

Bug fixes

(client) fire an error event on middleware failure for non-root namespace (https://github.com/socketio/socket.io-client/pull/1202)

Links:

v2.1.0

Compare Source

Features

// by default, the object is recursively scanned to check whether it contains some binary data
// in the following example, the check is skipped in order to improve performance
socket.binary(false).emit('plain-object', object);

// it also works at the namespace level
io.binary(false).emit('plain-object', object);
  • add support for dynamic namespaces (#​3195)
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => {
  // socket.nsp.name = '/dynamic-101'
});

// client-side
const client = require('socket.io-client')('/dynamic-101');

Bug fixes

  • properly emit 'connect' when using a custom namespace (#​3197)
  • include the protocol in the origins check (#​3198)

Important note ⚠️ from Engine.IO 3.2.0 release

There are two non-breaking changes that are somehow quite important:

var engine = require('engine.io');
var server = engine.listen(3000, {
  wsEngine: 'uws'
});
Links:

v2.0.4

Compare Source

Bug fixes

  • do not throw when receiving an unhandled error packet (#​3038)
  • reset rooms object before broadcasting from namespace (#​3039)
Links:

v2.0.3

Compare Source

Bug fixes

  • reset rooms object before broadcasting (#​2970)
  • fix middleware initialization (#​2969)
Links:

v2.0.2

Compare Source

Bug fixes

  • fix timing issues with middleware (#​2948)
Links:

v2.0.1

Compare Source

Bug fixes

- update path of client file (#​2934)

Links:

v2.0.0

Compare Source

This major release brings several performance improvements:

  • uws is now the default Websocket engine. It should bring significant improvement in performance (particularly in terms of memory consumption) (https://github.com/socketio/engine.io/releases/tag/2.0.0)

  • the Engine.IO and Socket.IO handshake packets were merged, reducing the number of roundtrips necessary to establish a connection. (#​2833)

  • it is now possible to provide a custom parser according to the needs of your application (#​2829). Please take a look at the example for more information.

Please note that this release is not backward-compatible, due to:

Please also note that if you are using a self-signed certificate, rejectUnauthorized now defaults to true (https://github.com/socketio/engine.io-client/pull/558).

Finally, the API documentation is now in the repository (here), and the content of the website here. Do not hesitate if you see something wrong or missing!

The full list of changes:

Besides, we are proud to announce that Socket.IO is now a part of open collective: https://opencollective.com/socketio. More on that later.

v1.7.4

Compare Source

  • [chore] Bump engine.io to version 1.8.4

v1.7.3

Compare Source

  • [chore] Bump engine.io-client to version 1.8.3

v1.7.2

Compare Source

  • [chore] Bump engine.io to version 1.8.2 (#​2782)
  • [fix] Fixes socket.use error packet (#​2772)

v1.7.1

Compare Source

(following socket.io-client update)

v1.7.0

Compare Source

  • [docs] Comment connected socket availability for adapters (#​2081)
  • [docs] Fixed grammar issues in the README.md (#​2159)
  • [feature] serve sourcemap for socket.io-client (#​2482)
  • [feature] Add a local flag (#​2628)
  • [chore] Bump engine.io to version 1.8.1 (#​2765)
  • [chore] Update client location and serve minified file (#​2766)

v1.6.0

Compare Source

  • [fix] Make ETag header comply with standard. (#​2603)
  • [feature] Loading client script on demand. (#​2567)
  • [test] Fix leaking clientSocket (#​2721)
  • [feature] Add support for all event emitter methods (#​2601)
  • [chore] Update year to 2016 (#​2456)
  • [feature] Add support for socket middleware (#​2306)
  • [feature] add support for Server#close(callback) (#​2748)
  • [fix] Don't drop query variables on handshake (#​2745)
  • [example] Add disconnection/reconnection logs to the chat example (#​2675)
  • [perf] Minor code optimizations (#​2219)
  • [chore] Bump debug to version 2.3.3 (#​2754)
  • [chore] Bump engine.io to version 1.8.0 (#​2755)
  • [chore] Bump socket.io-adapter to version 0.5.0 (#​2756)

v1.5.1

Compare Source

  • [fix] Avoid swallowing exceptions thrown by user event handlers (#​2682)
  • [test] Use client function to unify client in test script (#​2731)
  • [docs] Add link to LICENSE (#​2221)
  • [docs] Fix JSDoc of optional parameters (#​2465)
  • [docs] Fix typo (#​2724)
  • [docs] Link readme npm package badge to npm registry page (#​2612)
  • [docs] Minor fixes (#​2526)
  • [chore] Bump socket.io-parser to 2.3.0 (#​2730)
  • [chore] Add Github issue and PR templates (#​2733)
  • [chore] Bump engine.io to 1.7.2 (#​2729)
  • [chore] Bump socket.io-parser to 2.3.1 (#​2734)

v1.5.0

Compare Source

  • [feature] stop append /# before id when no namespace (#​2509)
  • [feature] Add a 'disconnecting' event to access to socket.rooms upon disconnection (#​2332)
  • [fix] Fix query string management (#​2422)
  • [fix] add quote to exec paths, prevent error when spaces in path (#​2508)
  • [docs] Prevent mixup for new programmers (#​2599)
  • [example] Fix chat display in Firefox (#​2477)
  • [chore] Add gulp & babel in the build process (#​2471)
  • [chore] Bump engine.io to 1.7.0 (#​2707)
  • [chore] Remove unused zuul-ngrok dependency (#​2708)
  • [chore] Point towards current master of socket.io-client (#​2710)
  • [chore] Restrict files included in npm package (#​2709)
  • [chore] Link build badge to master branch (#​2549)

v1.4.8

Compare Source

v1.4.7

Compare Source

v1.4.6

Compare Source

v1.4.5

Compare Source

v1.4.4

Compare Source

v1.4.3

Compare Source

v1.4.2

Compare Source

v1.4.1

Compare Source

v1.4.0

Compare Source

v1.3.7

Compare Source

v1.3.6

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Pin dependency socket.io to v1.7.4 [SECURITY] Pin dependency socket.io to 1.7.4 [SECURITY] May 9, 2021
@renovate renovate bot changed the title Pin dependency socket.io to 1.7.4 [SECURITY] Pin dependency socket.io to v1.7.4 [SECURITY] May 15, 2021
@renovate renovate bot changed the title Pin dependency socket.io to v1.7.4 [SECURITY] Pin dependency socket.io to v [SECURITY] Mar 7, 2022
@renovate renovate bot changed the title Pin dependency socket.io to v [SECURITY] Pin dependency socket.io to v1.7.4 [SECURITY] Sep 25, 2022
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from cf60b7d to a9ec6f3 Compare November 20, 2022 17:49
@renovate renovate bot changed the title Pin dependency socket.io to v1.7.4 [SECURITY] Update dependency socket.io to v4 [SECURITY] Nov 20, 2022
@secure-code-warrior-for-github

Micro-Learning Topic: Race condition (Detected by phrase)

Matched on "race condition"

What is this? (2min video)

A race condition is a flaw that produces an unexpected result when the timing of actions impact other actions.

Try a challenge in Secure Code Warrior

@secure-code-warrior-for-github

Micro-Learning Topic: Denial of service (Detected by phrase)

Matched on "denial of service"

The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed. There are many ways to make a service unavailable for legitimate users by manipulating network packets, programming, logical, or resources handling vulnerabilities, among others. Source: https://www.owasp.org/index.php/Denial_of_Service

Try a challenge in Secure Code Warrior

@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Mar 23, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from a9ec6f3 to 505ff67 Compare March 23, 2023 19:13
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Apr 3, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 505ff67 to 292d7e6 Compare April 3, 2023 09:44
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Apr 3, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 292d7e6 to 5e3aa15 Compare April 3, 2023 11:38
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Apr 17, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 5e3aa15 to 09df5a3 Compare April 17, 2023 11:46
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Apr 17, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 09df5a3 to aa8d26b Compare April 17, 2023 15:24
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from aa8d26b to 8deefef Compare May 28, 2023 08:33
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] May 28, 2023
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] May 28, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 8deefef to c9e388a Compare May 28, 2023 12:52
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jun 4, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from c9e388a to 9bb22b0 Compare June 4, 2023 14:08
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jun 8, 2023
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jun 16, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 4b2b335 to 3328f0a Compare June 16, 2023 06:10
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jun 16, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 3328f0a to e787667 Compare June 18, 2023 11:35
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jun 18, 2023
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] May 15, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 2f89513 to 2eadb9e Compare May 15, 2024 21:43
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] May 15, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 2eadb9e to c717b91 Compare June 4, 2024 10:45
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jun 4, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from c717b91 to 97ca959 Compare June 4, 2024 12:33
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jun 4, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 97ca959 to c104750 Compare June 19, 2024 22:58
Copy link

coderabbitai bot commented Jun 19, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from c104750 to 00ee4b1 Compare June 27, 2024 08:02
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jun 27, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 00ee4b1 to 60986a0 Compare June 27, 2024 09:27
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jun 27, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 60986a0 to f2d89a9 Compare July 12, 2024 15:39
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 12, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from f2d89a9 to 50977e6 Compare July 12, 2024 18:49
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 12, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 50977e6 to ad6019f Compare July 14, 2024 11:22
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 14, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from ad6019f to 66c791d Compare July 14, 2024 13:50
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 14, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 66c791d to aae203d Compare July 21, 2024 13:20
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 21, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from aae203d to e2db313 Compare July 21, 2024 17:36
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 21, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from e2db313 to 29a822b Compare July 28, 2024 14:25
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 28, 2024
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 29a822b to 217e426 Compare July 28, 2024 17:40
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 28, 2024
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.

0 participants