CVE-2023-22794 — SQL Injection Vulnerability via ActiveRecord comments
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.
Who exploits it and how urgent it is
A 0–100 score combining confirmed exploitation, ransomware and APT use, public exploits, EPSS and severity.
How the score was calculated
- EPSS 2.2% (30-day exploitation probability)+12
- Technical severity (high)+6
The score orders the patch queue; it does not replace your asset context (internet exposure, criticality, compensating controls).
Triage
Is it exploited, how likely is exploitation, what does it touch, and how severe do the sources call it.
Remediation
Fixes and mitigations documented by the sources — linked to the original advisory.
- Documented patch — discuss.rubyonrails.org (NIST National Vulnerability Database)
- Rubygems Activerecord: fixed in version 6.0.6.1 — github.com (GitHub Security Advisories)
- Rubygems Activerecord: fixed in version 6.1.7.1 — github.com (GitHub Security Advisories)
- Rubygems Activerecord: fixed in version 7.0.4.1 — github.com (GitHub Security Advisories)
First 24 hours
Ordered from the record’s own fields — exposure first, because you cannot patch what you have not found. A rule-generated starting point.
- Identify exposed assets running the affected vendor/product/version combinations (Activerecord Project Activerecord, Rubygems Activerecord).
- Apply the fixed version or the patch documented under Remediation.
- Search available logs for exploit probes matching the vulnerability class (injection), errors and authentication anomalies.
Affected scope
Vendor, product and versions as the sources word them.
| Vendor | Product | Versions | Status | Source |
|---|---|---|---|---|
| Activerecord Project | Activerecord | ≥ 6.0.0 and < 6.0.6.1≥ 6.1.0 and < 6.1.7.1≥ 7.0.0 and < 7.0.4.1 | Vulnerable | NIST National Vulnerability Database |
| Rubygems | Activerecord | ≥ 6.0.0 and < 6.0.6.1≥ 6.1.0 and < 6.1.7.1≥ 7.0.0 and < 7.0.4.1 | Vulnerable | GitHub Security Advisories |
Attack characteristics
The CVSS vector, decoded. It describes the attack, not your exposure to it.
Every base score collected
Sources score independently and may disagree; each row says who scored it and under which version.
| Score | Version | Severity | Expl. | Impact | Scored by |
|---|---|---|---|---|---|
| 8.8 | CVSS 3.1 | High | 2.8 | 5.9 | nvd@nist.gov via NIST National Vulnerability Database |
| 8.8 | CVSS 3.1 | High | — | — | GitHub, Inc. via GitHub Security Advisories |
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (score shown at the top: nvd@nist.gov) Weakness MITRE
Weakness class according to MITRE’s CWE catalog.
EPSS over time FIRST
Oct 23, 2026 → Oct 29, 2026 · 7 reading(s) · max 2.15%
Detection
Read off the CVSS vector and the weakness class. Starting points, not tested rules.
- Prioritize edge telemetry for the network-reachable component (proxy, WAF, IDS/IPS).
- Look for parameters with command/query metacharacters and unexpected child processes of the service.
Timeline
What happened to this CVE, newest first.
- 2026
- Fix documented
- Affected products added · rubygems/activerecord
- Record published
- Fix documented
- Affected products added · activerecord project/activerecord
- CVSS changed · 8.8
- Source status changed · → Modified
- Record created in this database
- 2023
- CVE published
Source activity
Repeated readings are counted rather than listed.
- 2× References added · Oct 23, 2026 – Oct 23, 2026
- 1× Official description updated · Oct 23, 2026 – Oct 23, 2026
References
8 on the record
- discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comment
- security.netapp.com/advisory/ntap-20240202-0008/
- github.com/rails/rails/releases/tag/v7.0.4.1
- github.com/advisories/GHSA-hq7p-j377-6v63
- github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2023-22794
- nvd.nist.gov/vuln/detail/CVE-2023-22794
- www.debian.org/security/2023/dsa-5372
- github.com/rails/rails/commit/d7aba06953f9fa789c411676b941d20df8ef73de
Elsewhere on this site
Related CVEs (same products)
- High CVE-2022-44566 Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter Feb 9, 2023
Not in any source we poll
Listed rather than left blank: an empty field and an unmeasured one look identical on screen, and only one is a reason to look elsewhere.
- No CISA SSVC assessment.
- No confirmed IOCs, IP addresses, domains, file hashes, or malware artifacts supplied.
- No organization-specific asset inventory, compensating-control status, or patch deployment evidence supplied.
- No exploit packet captures, log samples, or incident case IDs supplied.
Answered from this record
Text assembled only from the fields above — no additional claims.
What should defenders know first?
CVE-2023-22794 is "SQL Injection Vulnerability via ActiveRecord comments", rated High. It affects Activerecord (Activerecord Project); versions are in the scope table. It is not in CISA KEV, which does not rule out exploitation. CVSS 8.8 describes technical severity. EPSS 2.15% estimates the probability of exploitation in 30 days; neither replaces your asset context. First verify whether exposed or business-critical assets run the affected versions, apply vendor fixes or mitigations, and preserve logs for review.
Comments
Moderated technical discussion. Read the community guidelines.
No comments yet.
Sign in or create an account to comment and suggest corrections.