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

[Snyk] Upgrade: debug, engine.io, socket.io-adapter #73

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

Conversation

X-oss-byte
Copy link
Owner

snyk-top-banner

Snyk has created this PR to upgrade multiple dependencies.

👯 The following dependencies are linked and will therefore be updated together.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

Name Versions Released on

debug
from 4.3.4 to 4.3.6 | 2 versions ahead of your current version | a month ago
on 2024-07-27
engine.io
from 6.5.0 to 6.6.0 | 7 versions ahead of your current version | 3 months ago
on 2024-06-21
socket.io-adapter
from 2.5.2 to 2.5.5 | 3 versions ahead of your current version | 3 months ago
on 2024-06-18

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
high severity Denial of Service (DoS)
SNYK-JS-WS-7266574
696 Proof of Concept
Release notes
Package name: debug from debug GitHub release notes
Package name: engine.io
  • 6.6.0 - 2024-06-21

    Bug Fixes

    • fix websocket and webtransport send callbacks (#699) (fc21c4a)
    • properly call the send callback during upgrade (362bc78)
    • types: make socket.request writable (#697) (0efa04b)

    Performance Improvements

    • do not reset the hearbeat timer on each packet (5359bae)
    • websocket: use bound callbacks (9a68c8c)

    Credits

    Huge thanks to Jonathan Perret for their contributions!

    Links

  • 6.5.5 - 2024-06-18

    This release contains a bump of the ws dependency, which includes an important security fix.

    Advisory: GHSA-3h5v-q93c-6h6q

    Bug Fixes

    Links

  • 6.5.4 - 2023-11-09

    This release contains some minor changes which should improve the memory usage of the server, notably this.

    Links

  • 6.5.3 - 2023-10-06

    Bug Fixes

    • improve compatibility with node16 module resolution (#689) (c6bf8c0)
    • webtransport: properly handle abruptly closed connections (ff1c861)

    Links

  • 6.5.2 - 2023-08-02

    Bug Fixes

    • webtransport: add proper framing (a306db0)

    Links

  • 6.5.2-alpha.1 - 2023-08-01
  • 6.5.1 - 2023-06-27

    Bug Fixes

    • prevent crash when accessing TextDecoder (#684) (6dd2bc4)

    Credits

    Huge thanks to @ iowaguy for helping!

    Links

  • 6.5.0 - 2023-06-16

    Bug Fixes

    • uws: discard any write to an aborted uWS response (#682) (3144d27)

    Features

    Support for WebTransport

    The Engine.IO server can now use WebTransport as the underlying transport.

    WebTransport is a web API that uses the HTTP/3 protocol as a bidirectional transport. It's intended for two-way communications between a web client and an HTTP/3 server.

    References:

    Until WebTransport support lands in Node.js, you can use the @ fails-components/webtransport package:

    https://w3c.github.io/webtransport/#custom-certificate-requirements)
    const cert = readFileSync("/path/to/my/cert.pem");
    const key = readFileSync("/path/to/my/key.pem");

    const httpsServer = createServer({
    key,
    cert
    });

    httpsServer.listen(3000);

    const engine = new Server({
    transports: ["polling", "websocket", "webtransport"] // WebTransport is not enabled by default
    });

    engine.attach(httpsServer);

    const h3Server = new Http3Server({
    port: 3000,
    host: "0.0.0.0",
    secret: "changeit",
    cert,
    privKey: key,
    });

    (async () => {
    const stream = await h3Server.sessionStream("/engine.io/");
    const sessionReader = stream.getReader();

    while (true) {
    const { done, value } = await sessionReader.read();
    if (done) {
    break;
    }
    engine.onWebTransportSession(value);
    }
    })();

    h3Server.startServer();">

    import { readFileSync } from "fs";
    import { createServer } from "https";
    import { Server } from "engine.io";
    import { Http3Server } from "@ fails-components/webtransport";

    // WARNING: the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements)
    const cert = readFileSync("/path/to/my/cert.pem");
    const key = readFileSync("/path/to/my/key.pem");

    const httpsServer = createServer({
    key,
    cert
    });

    httpsServer.listen(3000);

    const engine = new Server({
    transports: ["polling", "websocket", "webtransport"] // WebTransport is not enabled by default
    });

    engine.attach(httpsServer);

    const h3Server = new Http3Server({
    port: 3000,
    host: "0.0.0.0",
    secret: "changeit",
    cert,
    privKey: key,
    });

    (async () => {
    const stream = await h3Server.sessionStream("/engine.io/");
    const sessionReader = stream.getReader();

    while (true) {
    const { done, value } = await sessionReader.read();
    if (done) {
    break;
    }
    engine.onWebTransportSession(value);
    }
    })();

    h3Server.startServer();

    Added in 123b68c.

    Credits

    Huge thanks to @ OxleyS for helping!

    Links

from engine.io GitHub release notes
Package name: socket.io-adapter
  • 2.5.5 - 2024-06-18

    Diff: 2.5.4...2.5.5

  • 2.5.4 - 2024-02-22

    Bug Fixes

    • ensure the order of the commands (a13f35f)
    • types: ensure compatibility with TypeScript < 4.5 (ca397f3)

    Links

  • 2.5.3 - 2024-02-21

    Two abstract classes were imported from the Redis adapter repository:

    • the ClusterAdapter class, which manages the messages sent between the server instances of the cluster
    • the ClusterAdapterWithHeartbeat class, which extends the ClusterAdapter and adds a heartbeat mechanism in order to check the healthiness of the other instances

    Other adapters can then just extend those classes and only have to implement the pub/sub mechanism (and not the internal chit-chat protocol):

    class MyAdapter extends ClusterAdapterWithHeartbeat {
    constructor(nsp, pubSub, opts) {
    super(nsp, opts);
    this.pubSub = pubSub;
    pubSub.subscribe("main-channel", (message) => this.onMessage(message));
    pubSub.subscribe("specific-channel#" + this.uid, (response) => this.onResponse(response));
    }

    doPublish(message) {
    return this.pubSub.publish("main-channel", message);
    }

    doPublishResponse(requesterUid, response) {
    return this.pubSub.publish("specific-channel#" + requesterUid, response);
    }
    }

    Besides, the number of "timeout reached: only x responses received out of y" errors (which can happen when a server instance leaves the cluster) should be greatly reduced by this commit.

    Bug Fixes

    • cluster: fix count in fetchSockets() method (80af4e9)
    • cluster: notify the other nodes when closing (0e23ff0)

    Performance Improvements

    • cluster: use timer.refresh() (d99a71b)

    Links

  • 2.5.2 - 2023-01-12

    The ws dependency was moved from peerDependencies to dependencies, in order to prevent issues like this.

    Links

from socket.io-adapter GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade:
  - debug from 4.3.4 to 4.3.6.
    See this package in npm: https://www.npmjs.com/package/debug
  - engine.io from 6.5.0 to 6.6.0.
    See this package in npm: https://www.npmjs.com/package/engine.io
  - socket.io-adapter from 2.5.2 to 2.5.5.
    See this package in npm: https://www.npmjs.com/package/socket.io-adapter

See this project in Snyk:
https://app.snyk.io/org/sammytezzy/project/0c2e6abe-c98c-464b-82b2-c5b800caf132?utm_source=github&utm_medium=referral&page=upgrade-pr
Copy link

stackblitz bot commented Sep 7, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Sep 7, 2024

⚠️ No Changeset found

Latest commit: d0bd960

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. Here's why:

  • It seems to have been created by a bot ('[Snyk]' found in title). We assume it knows what it's doing!
  • We don't review packaging changes - Let us know if you'd like us to change this.

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