Insecure randomness in socket.io
Affected versions of socket.io depend on Math.random() to create socket IDs, and therefore the IDs are predictable. With enough information on prior IDs, an attacker may be able to guess the socket ID and gain access to socket.io servers without authorization.
Recommendation
Update to v0.9.7 or later.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | socket.io | < 0.9.7 | 0.9.7 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2017-16031
- https://github.com/socketio/socket.io/issues/856
- https://github.com/socketio/socket.io/pull/857
- https://github.com/socketio/socket.io/commit/67b4eb9abdf111dfa9be4176d1709374a2b4ded8
- https://github.com/advisories/GHSA-qv2v-m59f-v5fw
- https://github.com/socketio/socket.io
- https://www.npmjs.com/advisories/321
- CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-330- Platform
- npm
- Package
socket.io- Disclosed
- 07.11.2018
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-qv2v-m59f-v5fw - CC BY 4.0
Vulnerability history: socket.io
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 3
- First → latest
- 11.2018 06.2024
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 1
- Medium 2
Disclosures per year
- 2018: 1
- 2019: 0
- 2020: 0
- 2021: 1
- 2022: 0
- 2023: 0
- 2024: 1
- 2025: 0
- 2026: 0
-
Insecure randomness in socket.io this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.