Uncaught Exception Affecting socket.io package, versions >=2.3.0 <2.5.1>=3.0.0 <4.6.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Uncaught Exception vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-SOCKETIO-7278048
  • published20 Jun 2024
  • disclosed19 Jun 2024
  • creditPaul Taylor

Introduced: 19 Jun 2024

CVE-2024-38355  (opens in a new tab)
CWE-248  (opens in a new tab)

How to fix?

Upgrade socket.io to version 2.5.1, 4.6.2 or higher.

Overview

socket.io is a node.js realtime framework server.

Affected versions of this package are vulnerable to Uncaught Exception in handling error events. If there is no listener set up for such events, an attacker can send packets containing them to crash the Node process.

Workaround

This vulnerability can be avoided by attaching a listener for error events, such as

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

CVSS Scores

version 4.0
version 3.1