Information

spring-data-neo4j library custom queries are vulnerable to Cypher injection via orderBy placeholder. The vulnerability allows a remote attacker to read database contents via blind reads, write read content into new nodes, or, if APOC and APOC file export are enabled, to write query results to a file in the database’s accessible file system via crafted sort order parameters. Exploitation requires an application that passes unvalidated user input as the orderBy value to a custom Cypher query using the placeholder directive.  

Recommendations

Upgrade Spring Data Neo4j to 8.0.9, 8.1.3, 8.2.0 or later (depending on your release line). The fix restricts functions callable in the orderBy directive to an allow list of built-in (non-APOC) functions; the list must be extended intentionally if other functions are needed.

For users who cannot update immediately: validate any user-supplied orderBy value against an allow list of known property names and sort directions before passing it to Spring Data Neo4j. Do not expose the orderBy input to untrusted users without validation.

Links