{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2023-22794","id":"CVE-2023-22794","title":"SQL Injection Vulnerability via ActiveRecord comments","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.","descriptionLong":"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.","published":"2023-02-09T00:00:00.000Z","updated":"2026-10-28T02:30:36.589571407Z","reserved":"2023-01-06T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"hackerone","metric":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"NVD"},"metrics":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub"}],"rating":"high","products":["https://github.com/rails/rails"],"affectedProducts":[{"vendor":"n/a","product":"https://github.com/rails/rails","defaultStatus":null,"versions":[{"version":"6.0.6.1, 6.1.7.1, 7.0.4.1","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"RubyGems","name":"activerecord","purl":"pkg:gem/activerecord","ranges":[">=6.0.0 <6.0.6.1",">=6.1.0 <6.1.7.1",">=7.0.0 <7.0.4.1"],"fixed":["6.0.6.1","6.1.7.1","7.0.4.1"],"advisory":"GHSA-hq7p-j377-6v63"}],"cwes":["CWE-89"],"aliases":["GHSA-hq7p-j377-6v63"],"references":[{"url":"https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117","tags":["x_transferred","Exploit","Patch","Vendor Advisory","web"]},{"url":"https://www.debian.org/security/2023/dsa-5372","tags":["vendor-advisory","x_transferred","advisory","web"]},{"url":"https://security.netapp.com/advisory/ntap-20240202-0008/","tags":["x_transferred","advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22794.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22794","tags":["advisory"]},{"url":"https://github.com/rails/rails/commit/d7aba06953f9fa789c411676b941d20df8ef73de","tags":["web"]},{"url":"https://github.com/rails/rails","tags":["package"]},{"url":"https://github.com/rails/rails/releases/tag/v7.0.4.1","tags":["web"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2023-22794.yml","tags":["web"]},{"url":"https://security.netapp.com/advisory/ntap-20240202-0008","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.02153,"epssPercentile":0.82514,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2023-22794","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22794","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2023-22794","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-hq7p-j377-6v63","ok":true,"note":"GHSA-hq7p-j377-6v63"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2023-22794","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":["ruby"],"critical":[],"attention":null}