Miggo Logo

CVE-2023-32695:
Insufficient validation when decoding a Socket.IO packet

7.3

CVSS Score
3.1

Basic Information

EPSS Score
0.37977%
Published
5/23/2023
Updated
11/18/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
socket.io-parsernpm>= 3.4.0, < 3.4.33.4.3
socket.io-parsernpm>= 4.0.4, < 4.2.34.2.3
socket.io-parsernpm< 3.3.43.3.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from insufficient input validation in Socket.IO's packet decoding logic. Patches introduced the isPayloadValid() function to enforce strict type checks on event names. The decodeString function (called by Decoder.add) previously allowed arrays with non-primitive first elements as event names. When such malformed packets were emitted via Socket.emit(), JavaScript's type coercion failed, causing uncaught exceptions. The commit diffs show these functions were modified to add validation, confirming their role in the vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t * sp**i*lly *r**t** So*k*t.IO p**k*t **n tri***r *n un**u**t *x**ption on t** So*k*t.IO s*rv*r, t*us killin* t** No**.js pro**ss. ``` Typ**rror: **nnot *onv*rt o*j**t to primitiv* v*lu* *t So*k*t.*mit (no**:*v*nts:***:**) *

Reasoning

T** vuln*r**ility st*ms *rom insu**i*i*nt input v*li**tion in So*k*t.IO's p**k*t ***o*in* lo*i*. P*t***s intro*u*** t** `isP*ylo**V*li*()` *un*tion to *n*or** stri*t typ* ****ks on *v*nt n*m*s. T** `***o**Strin*` *un*tion (**ll** *y `***o**r.***`) pr