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: , express, moment, redis, socket.io #44

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

Conversation

nejidevelops
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

@socket.io/redis-adapter
from 7.1.0 to 7.2.0 | 1 version ahead of your current version | 2 years ago
on 2022-05-03
express
from 4.18.2 to 4.19.2 | 4 versions ahead of your current version | 5 months ago
on 2024-03-25
moment
from 2.29.4 to 2.30.1 | 2 versions ahead of your current version | 8 months ago
on 2023-12-27
redis
from 4.0.2 to 4.7.0 | 29 versions ahead of your current version | a month ago
on 2024-07-29
socket.io
from 4.6.1 to 4.7.5 | 7 versions ahead of your current version | 6 months ago
on 2024-03-14

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
high severity Uncaught Exception
SNYK-JS-SOCKETIO-7278048
649 No Known Exploit
high severity Denial of Service (DoS)
SNYK-JS-SOCKETIOPARSER-5596892
649 No Known Exploit
high severity Denial of Service (DoS)
SNYK-JS-WS-7266574
649 Proof of Concept
medium severity Open Redirect
SNYK-JS-EXPRESS-6474509
649 No Known Exploit
Release notes
Package name: @socket.io/redis-adapter
  • 7.2.0 - 2022-05-03

    Bug Fixes

    Features

    • broadcast and expect multiple acks (e4c40cc)

    This feature was added in socket.io@4.5.0:

    io.timeout(1000).emit("some-event", (err, responses) => {
      // ...
    });

    Thanks to this change, it will now work with multiple Socket.IO servers.

    Diff: 7.1.0...7.2.0

  • 7.1.0 - 2021-11-29

    Features

    • add support for redis v4 (aa681b3)
    • do not emit "error" events anymore (8e5c84f)

    Error handling can now be done on the redis clients directly.

    Before:

    io.of("/").adapter.on("error", () => {
      // ...
    });

    After:

    pubClient.on("error", () => {
    // something went wrong
    });

    subClient.on("error", () => {
    // something went wrong
    });

    • send response to the requesting node only (f66de11)

    A more performant way to do request-response is available behind an option, publishOnSpecificResponseChannel:

    const io = require('socket.io')(3000);
    const { createClient } = require('redis');
    const redisAdapter = require('@ socket.io/redis-adapter');

    const pubClient = createClient({ host: 'localhost', port: 6379 });
    const subClient = pubClient.duplicate();
    io.adapter(redisAdapter(pubClient, subClient, {
    publishOnSpecificResponseChannel: true
    }));

    To upgrade an existing deployment, you will need to upgrade all nodes to the latest version with publishOnSpecificResponseChannel = false, and then toggle the option on each node.

    Please check the commit for more information.

    Links

from @socket.io/redis-adapter GitHub release notes
Package name: express from express GitHub release notes
Package name: moment from moment GitHub release notes
Package name: redis
  • 4.7.0 - 2024-07-29

    Enhancements

    • Upgrade @ redis/client from 1.5.16 to 1.6.0
    • Upgrade @ redis/json from 1.0.6 to 1.0.7
    • Upgrade @ redis/search from 1.1.6 to 1.2.0
    • Upgrade @ redis/time-series from 1.0.5 to 1.1.0
  • 4.6.15 - 2024-07-02

    Enhancements

    • Upgrade @ redis/client from 1.5.16 to 1.5.17
  • 4.6.14 - 2024-05-16

    Enhancements

    • Upgrade @ redis/client from 1.5.14 to 1.5.16
  • 4.6.13 - 2024-02-05
  • 4.6.12 - 2023-12-18
  • 4.6.11 - 2023-11-20
  • 4.6.10 - 2023-09-22
  • 4.6.9 - 2023-09-19
  • 4.6.8 - 2023-08-23
  • 4.6.7 - 2023-05-31
  • 4.6.6 - 2023-04-27
  • 4.6.5 - 2023-02-24
  • 4.6.4 - 2023-01-30
  • 4.6.3 - 2023-01-28
  • 4.6.2 - 2023-01-27
  • 4.6.1 - 2023-01-26
  • 4.6.0 - 2023-01-25
  • 4.5.1 - 2022-11-24
  • 4.5.0 - 2022-11-10
  • 4.4.0 - 2022-11-01
  • 4.3.1 - 2022-09-06
  • 4.3.0 - 2022-08-22
  • 4.2.0 - 2022-07-05
  • 4.1.1 - 2022-06-30
  • 4.1.0 - 2022-05-02
  • 4.0.6 - 2022-03-31
  • 4.0.5 - 2022-03-31
  • 4.0.4 - 2022-02-22
  • 4.0.3 - 2022-01-31
  • 4.0.2 - 2022-01-13
from redis GitHub release notes
Package name: socket.io
  • 4.7.5 - 2024-03-14

    Bug Fixes

    • close the adapters when the server is closed (bf64870)
    • remove duplicate pipeline when serving bundle (e426f3e)

    Links

  • 4.7.4 - 2024-01-12

    Bug Fixes

    • typings: calling io.emit with no arguments incorrectly errored (cb6d2e0), closes #4914

    Links

  • 4.7.3 - 2024-01-03

    Bug Fixes

    • return the first response when broadcasting to a single socket (#4878) (df8e70f)
    • typings: allow to bind to a non-secure Http2Server (#4853) (8c9ebc3)

    Links

  • 4.7.2 - 2023-08-02

    Bug Fixes

    • clean up child namespace when client is rejected in middleware (#4773) (0731c0d)
    • webtransport: properly handle WebTransport-only connections (3468a19)
    • webtransport: add proper framing (a306db0)

    Links

  • 4.7.1 - 2023-06-28

    The client bundle contains a few fixes regarding the WebTransport support.

    Links

  • 4.7.0 - 2023-06-22

    Bug Fixes

    • remove the Partial modifier from the socket.data type (#4740) (e5c62ca)

    Features

    Support for WebTransport

    The Socket.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 io = new Server(httpsServer, {
    transports: ["polling", "websocket", "webtransport"] // WebTransport is not enabled by default
    });

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

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

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

    h3Server.startServer();">

    import { readFileSync } from "fs";
    import { createServer } from "https";
    import { Server } from "socket.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 io = new Server(httpsServer, {
    transports: ["polling", "websocket", "webtransport"] // WebTransport is not enabled by default
    });

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

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

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

    h3Server.startServer();

    Added in 123b68c.

    Client bundles with CORS headers

    The bundles will now have the right Access-Control-Allow-xxx headers.

    Added in 63f181c.

    Links

  • 4.6.2 - 2023-05-31

    Bug Fixes

    • exports: move types condition to the top (#4698) (3d44aae)

    Links

  • 4.6.1 - 2023-02-20
from socket.io 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:
  - @socket.io/redis-adapter from 7.1.0 to 7.2.0.
    See this package in npm: https://www.npmjs.com/package/@socket.io/redis-adapter
  - express from 4.18.2 to 4.19.2.
    See this package in npm: https://www.npmjs.com/package/express
  - moment from 2.29.4 to 2.30.1.
    See this package in npm: https://www.npmjs.com/package/moment
  - redis from 4.0.2 to 4.7.0.
    See this package in npm: https://www.npmjs.com/package/redis
  - socket.io from 4.6.1 to 4.7.5.
    See this package in npm: https://www.npmjs.com/package/socket.io

See this project in Snyk:
https://app.snyk.io/org/newtonombese1/project/0f7cb4e0-d844-44aa-bc90-5957f9bcb149?utm_source=github&utm_medium=referral&page=upgrade-pr
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.

Calling io.emit("event") with events that has no arguments result in TypeScript errors
2 participants