{"id":"CVE-2023-22794","published":"2023-02-09T00:00:00Z","modified":"2024-08-02T10:20:30Z","title":"A vulnerability in ActiveRecord <6.0.6.1, v6.1.7.1 and v7.0.4.1 related to the sanitization of comments","vendor":null,"product":null,"tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.02176,"percentile":0.82761,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117","tags":[]},{"url":"https://www.debian.org/security/2023/dsa-5372","tags":["vendor-advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20240202-0008/","tags":[]}],"priority":{"score":16.6,"factors":[{"name":"EPSS percentile","points":16.55}]},"affectedVersions":[{"vendor":"n/a","product":"https://github.com/rails/rails","versions":["6.0.6.1, 6.1.7.1, 7.0.4.1"]}],"affected":[{"ecosystem":"RubyGems","package":"activerecord","vulnerableRanges":[">=6.0.0, <6.0.6.1",">=6.1.0, <6.1.7.1",">=7.0.0, <7.0.4.1"],"patched":["6.0.6.1","6.1.7.1","7.0.4.1"],"from":["GHSA-hq7p-j377-6v63"],"provenance":"source"}],"summary":{"text":"A flaw in the sanitization of comments in ActiveRecord (the Ruby on Rails database layer), in the affected 6.0.x, 6.1.x and 7.0.x release lines, lets malicious input passed to the annotate or optimizer_hints query methods, or to the QueryLogs annotations, reach the database under-sanitized. An attacker who can supply that input can inject SQL outside the intended comment, provided the application passes user-controlled data into one of those interfaces.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:35:05Z"},"euvd":{"id":"EUVD-2023-0490","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-22880","published":"2021-02-11","fixed":"6.1.2.1","kev":false},{"cve":"CVE-2022-32224","published":"2022-12-05","fixed":"7.0.3.1","kev":false,"link":{"from":"CVE-2022-32224","to":"CVE-2023-22794","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:activerecord","fromFixed":"6.0.5.1","toFixed":"6.0.6.1","daysApart":66},{"kind":"version-step","provenance":"source","package":"RubyGems:activerecord","fromFixed":"7.0.3.1","toFixed":"7.0.4.1","daysApart":66}]}},{"cve":"CVE-2022-44566","published":"2023-02-09","fixed":"7.0.4.1","kev":false},{"cve":"CVE-2023-22794","published":"2023-02-09","fixed":"7.0.4.1","kev":false},{"cve":"CVE-2025-55193","published":"2025-08-13","fixed":"8.0.2.1","kev":false}],"package":"RubyGems:activerecord"}}