Description
A vulnerability in ActiveRecord <6.0.6.1, v6.1.7.1 and v7.0.4.1 related to the sanitization of comments. If malicious user input is passed to either the `annotate` query method, the `optimizer_hints` query method, or through the QueryLogs interface which automatically adds annotations, it may be sent to the database withinsufficient sanitization and be able to inject SQL outside of the comment.
Affected products
activerecord_project: activerecord
References6
- discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerab… ExploitPatchVendor Advisory
- discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerab… ExploitPatchVendor Advisory
- security.netapp.com/advisory/ntap-20240202-0008/
- www.debian.org/security/2023/dsa-5372
- security.netapp.com/advisory/ntap-20240202-0008/
- www.debian.org/security/2023/dsa-5372
Metrics
- CVSS 3.1
-
8.8
HIGH
Score source: NVD
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - EPSS — exploit probability
- 2% percentile: 82 · as of 6 November 2026
- CWE
- CWE-89
Could this be exploited in your environment?
A patch closes the known hole. A penetration test shows what an attacker can still reach — with proof.