CVE-2022-21676

CVE-2022-21676 is a high-severity security vulnerability in engine.io (npm), affecting versions >= 4.0.0, < 4.1.2. It is fixed in 4.1.2, 5.2.1, 6.1.1.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Uncaught Exception in engine.io

Workarounds

There is no known workaround except upgrading to a safe version.

For more information

If you have any questions or comments about this advisory:

Thanks to Marcus Wejderot from Mevisio for the responsible disclosure.

Impact

A specially crafted HTTP request can trigger an uncaught exception on the Engine.IO server, thus killing the Node.js process.

RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear
at Receiver.getInfo (/.../node_modules/ws/lib/receiver.js:176:14)
at Receiver.startLoop (/.../node_modules/ws/lib/receiver.js:136:22)
at Receiver._write (/.../node_modules/ws/lib/receiver.js:83:10)
at writeOrBuffer (internal/streams/writable.js:358:12)

This impacts all the users of the engine.io package starting from version 4.0.0, including those who uses depending packages like socket.io.

CVE-2022-21676 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.1.2, 5.2.1, 6.1.1); upgrading removes the vulnerable code path.

Affected versions

engine.io (>= 4.0.0, < 4.1.2) engine.io (>= 5.0.0, < 5.2.1) engine.io (>= 6.0.0, < 6.1.1)

Security releases

engine.io → 4.1.2 (npm) engine.io → 5.2.1 (npm) engine.io → 6.1.1 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

A fix has been released for each major branch:

Version range Fixed version
[email protected] 4.1.2
[email protected] 5.2.1
[email protected] 6.1.1

Previous versions (< 4.0.0) are not impacted.

For socket.io users:

Version range engine.io version Needs minor update?
[email protected] ~6.1.0 -
[email protected] ~6.0.0 Please upgrade to [email protected]
[email protected] ~5.2.0 -
[email protected] ~5.1.1 Please upgrade to [email protected]
[email protected] ~5.0.0 Please upgrade to [email protected]
[email protected] ~4.1.0 -
[email protected] ~4.0.0 Please upgrade to [email protected] or [email protected] (see here)

In most cases, running npm audit fix should be sufficient. You can also use npm update engine.io --depth=9999.

Frequently Asked Questions

  1. What is CVE-2022-21676? CVE-2022-21676 is a high-severity security vulnerability in engine.io (npm), affecting versions >= 4.0.0, < 4.1.2. It is fixed in 4.1.2, 5.2.1, 6.1.1.
  2. How severe is CVE-2022-21676? CVE-2022-21676 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of engine.io are affected by CVE-2022-21676? engine.io (npm) versions >= 4.0.0, < 4.1.2 is affected.
  4. Is there a fix for CVE-2022-21676? Yes. CVE-2022-21676 is fixed in 4.1.2, 5.2.1, 6.1.1. Upgrade to this version or later.
  5. Is CVE-2022-21676 exploitable, and should I be worried? Whether CVE-2022-21676 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2022-21676 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2022-21676?
    • Upgrade engine.io to 4.1.2 or later
    • Upgrade engine.io to 5.2.1 or later
    • Upgrade engine.io to 6.1.1 or later

Other vulnerabilities in engine.io

Stop the waste.
Protect your environment with Kodem.