CVE-2021-34371 Deserialization of Untrusted Data in Neo4j
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.
| Package | Affected | Fixed in |
|---|---|---|
org.neo4j:neo4j Maven | All versions | 3.5.0 |
org.neo4j:neo4j Maven | All versions | 3.5.0 |
neo4j Bitnami | All versions | 3.4.19 |
neo4j-enterprise Bitnami | All versions to 3.4.18 | None |
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.
Other vulnerabilities in n/a
- CVE-2018-18389 Incorrect access control in Neo4j Enterprise Database Server via LDAP authentication
- CVE-2013-7259 Neo4J vulnerable to Cross-Site Request Forgery
- CVE-2024-34517 Neo4j Cypher component mishandles IMMUTABLE privileges
- CVE-2026-14587 Unathenticated connection can hold Bolt channel open
- CVE-2026-1471 Caching of authentication context
Sources
Also known as BIT-neo4j-2021-34371, BIT-neo4j-enterprise-2021-34371, GHSA-pc4w-8v5j-29w9.