cve.bz

CVE-2023-22794 activerecord project activerecord: SQL Injection

8.8 highExploit referenceEPSS 2.2%Fix available

High (8.8) in activerecord project activerecord. EPSS 2.2% estimated probability of exploitation activity in the next 30 days. Fixed in activerecord 6.0.6.1, 6.1.7.1, 7.0.4.1.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
2.2% (unchanged from 2.2% a week ago; 2.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 83rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2023-22794 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-22794?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-22794?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-22794 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
activerecord_project:activerecordfrom 6.0.0 before 6.0.6.1
activerecord_project:activerecordfrom 6.1.0 before 6.1.7.1
activerecord_project:activerecordfrom 7.0.0 before 7.0.4.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-hq7p-j377-6v63RubyGemsactiverecord>=6.0.0 <6.0.6.16.0.6.1
GHSA-hq7p-j377-6v63RubyGemsactiverecord>=6.1.0 <6.1.7.16.1.7.1
GHSA-hq7p-j377-6v63RubyGemsactiverecord>=7.0.0 <7.0.4.17.0.4.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11rails2:6.0.3.7+dfsg-2+deb11u1DSA-5372-1
Debian12, 13, 14rails2:6.1.7.3+dfsg-1DEBIAN-CVE-2023-22794
Ubuntu24.04:LTS, 25.10, 26.04:LTS and 5 morerailsno fix listedUBUNTU-CVE-2023-22794
Red Hatsatellite:6.14::el8foreman, foreman-cli, foreman-ec2 and 11 more0:3.7.0.9-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8rubygem-actionpack, rubygem-activerecord, rubygem-activesupport0:6.1.7.3-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8rubygem-git0:1.18.0-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8rubygem-globalid0:1.1.0-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8rubygem-kubeclient0:4.10.1-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8yggdrasil-worker-forwarder0:0.0.3-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8, satellite_capsule:6.14::el8puppet-agent0:7.26.0-3.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8, satellite_capsule:6.14::el8puppetserver0:7.11.0-1.el8satRHSA-2023:6818
Red Hatsatellite:6.14::el8, satellite_capsule:6.14::el8python-django, python39-django0:3.2.21-1.el8pcRHSA-2023:6818
Red Hatsatellite:6.14::el8, satellite_capsule:6.14::el8python-future, python39-future0:0.18.3-1.el8pcRHSA-2023:6818
Red Hatsatellite:6.14::el8, satellite_capsule:6.14::el8python-gitpython, python39-gitpython0:3.1.32-1.el8pcRHSA-2023:6818
Red Hatsatellite:6.14::el8, satellite_capsule:6.14::el8python-pulp-ansible, python39-pulp-ansible1:0.16.0-1.el8pcRHSA-2023:6818
5 more for Red Hat in the JSON and on Red Hat's page.
openSUSETumbleweedrubygem-activerecord-7.07.0.4.1-1.1openSUSE-SU-2024:12766-1
openSUSETumbleweedrubygem-activerecord-7.07.0.8.4-1.1openSUSE-SU-2024:14069-1
openSUSETumbleweedrubygem-activerecord-7.07.0.8.6-1.3openSUSE-SU-2025:15112-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · openSUSE.

Red Hat

Red Hat rates this Important.

ProductPackageStateAdvisory
Red Hat Satellite 6.14 for RHEL 8rubygem-activerecord-0:6.1.7.3-1.el8satFixed 2023-11-08RHSA-2023:6818

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2023-22794.

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON