CVE-2021-34371 Deserialization of Untrusted Data in Neo4j

Critical 9.8 Published Updated

Attackers can achieve remote code execution via unsafe Java deserialization in the Neo4j RMI service when the shell server is enabled.

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

What is CVE-2021-34371?

CVE-2021-34371 is a critical unsafe deserialization vulnerability in n/a, published on 5 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Neo4j through 3.4.18 (with the shell server enabled) exposes an RMI service that arbitrarily deserializes Java objects, e.g., through setSessionVariable. An attacker can abuse this for remote code execution because there are dependencies with exploitable gadget chains.

Weakness: CWE-502

Which versions are affected by CVE-2021-34371?

4 open source packages ship an affected version, including org.neo4j:neo4j, neo4j and neo4j-enterprise. It affects 1 product.

PackageAffectedFixed in
org.neo4j:neo4j MavenAll versions3.5.0
org.neo4j:neo4j MavenAll versions3.5.0
neo4j BitnamiAll versions3.4.19
neo4j-enterprise BitnamiAll versions to 3.4.18None

Products include Neo4j Neo4j.

How do I fix CVE-2021-34371?

Upgrade org.neo4j:neo4j to 3.5.0 or later.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2021-34371 being exploited?

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

Public exploit code: 2 proofs of concept on GitHub.

Sources

Also known as BIT-neo4j-2021-34371, BIT-neo4j-enterprise-2021-34371, GHSA-pc4w-8v5j-29w9.

Is CVE-2021-34371 in your software?

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

Check your SBOMs for free