{"id":"CVE-2023-22794","details":"A vulnerability in ActiveRecord \u003c6.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.","aliases":["GHSA-hq7p-j377-6v63"],"modified":"2026-04-10T04:55:28.368621Z","published":"2023-02-09T20:15:11.353Z","related":["openSUSE-SU-2024:12766-1","openSUSE-SU-2024:14069-1","openSUSE-SU-2025:15112-1"],"references":[{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20240202-0008/"},{"type":"ADVISORY","url":"https://www.debian.org/security/2023/dsa-5372"},{"type":"FIX","url":"https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/rails/rails","events":[{"introduced":"66cabeda2c46c582d19738e1318be8d59584cc5b"},{"fixed":"28bb76d3efc39b2ef663dfe2346f7c2621343cd6"},{"introduced":"914caca2d31bd753f47f9168f2a375921d9e91cc"},{"fixed":"c443466a99f8ed951605fb4993a01de5e41349a4"},{"introduced":"984c3ef2775781d47efa9f541ce570daa2434a80"},{"fixed":"23e0345fe900dfd7edd6e8e5a7a6bd54b2a7d2ed"}],"database_specific":{"versions":[{"introduced":"6.0.0"},{"fixed":"6.0.6.1"},{"introduced":"6.1.0"},{"fixed":"6.1.7.1"},{"introduced":"7.0.0"},{"fixed":"7.0.4.1"}]}}],"versions":["v6.0.0","v6.0.4","v6.0.5","v6.0.6","v6.1.0","v6.1.1","v6.1.2","v6.1.3","v6.1.4","v6.1.5","v6.1.7","v7.0.0","v7.0.1","v7.0.2","v7.0.3","v7.0.4"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-22794.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}