CVE-2022-2421 Socket.io - Improper type validation in attachment parsing

Critical 10.0 Published Updated

Attackers can inject arbitrary function references into query objects via improper type validation in Socket.io parser, potentially leading to code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-2421?

CVE-2022-2421 is a critical code injection vulnerability in Socket.io-Parser, published on 25 Oct 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Due to improper type validation in attachment parsing the Socket.io js library, it is possible to overwrite the _placeholder object which allows an attacker to place references to functions at arbitrary places in the resulting query object.

Weakness: CWE-89

Which versions are affected by CVE-2022-2421?

8 open source packages ship an affected version, including socket.io-parser. It affects 1 product.

PackageAffectedFixed in
socket.io-parser npmAll versions3.3.3
socket.io-parser npmAll versions3.3.3
socket.io-parser npmFrom 3.4.03.4.2
socket.io-parser npmFrom 3.4.03.4.2
socket.io-parser npmFrom 4.0.04.0.5
socket.io-parser npmFrom 4.0.04.0.5
2 more packages
socket.io-parser npmFrom 4.1.04.2.1
socket.io-parser npmFrom 4.1.04.2.1

Products include Socket Socket.io-Parser.

How do I fix CVE-2022-2421?

Upgrade socket.io-parser to a fixed version for your release line: 3.3.3, 3.4.2, 4.0.5 or 4.2.1.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2022-2421 being exploited?

There is no known exploitation of CVE-2022-2421 in the wild and no public exploit code.

Sources

Also known as GHSA-qm95-pgcg-qqfq.

Is CVE-2022-2421 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free