SQL injection in https://github.com/rails/rails
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | https://github.com/rails/rails | 6.0.6.1, 6.1.7.1, 7.0.4.1 | — | No fix listed | CNA |
| — | activerecord (RubyGems) | 6.0.0 to before 6.0.6.1 | 6.0.6.1 | Patch available | GHSA-hq7p-j377-6v63 |
| — | activerecord (RubyGems) | 6.1.0 to before 6.1.7.1 | 6.1.7.1 | Patch available | GHSA-hq7p-j377-6v63 |
| — | activerecord (RubyGems) | 7.0.0 to before 7.0.4.1 | 7.0.4.1 | Patch available | GHSA-hq7p-j377-6v63 |
- https://github.com/rails/rails Vendor— Affected 6.0.6.1, 6.1.7.1, 7.0.4.1 Fixed in — No fix listed CNA
- activerecord (RubyGems) Vendor— Affected 6.0.0 to before 6.0.6.1 Fixed in 6.0.6.1 Patch available GHSA-hq7p-j377-6v63
- activerecord (RubyGems) Vendor— Affected 6.1.0 to before 6.1.7.1 Fixed in 6.1.7.1 Patch available GHSA-hq7p-j377-6v63
- activerecord (RubyGems) Vendor— Affected 7.0.0 to before 7.0.4.1 Fixed in 7.0.4.1 Patch available GHSA-hq7p-j377-6v63
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:activerecord_project:activerecord:*:*:*:*:*:ruby:*:* | 6.0.0 to before 6.0.6.1; 6.1.0 to before 6.1.7.1; 7.0.0 to before 7.0.4.1 | Vulnerable | Activerecord Project |
- cpe:2.3:a:activerecord_project:activerecord:*:*:*:*:*:ruby:*:* Versions 6.0.0 to before 6.0.6.1; 6.1.0 to before 6.1.7.1; 7.0.0 to before 7.0.4.1 Vulnerable ·Activerecord Project
Remediation
- Fix · GHSA-hq7p-j377-6v63 activerecord (RubyGems) Fixed in 6.0.6.1 Advisory →
- Fix · GHSA-hq7p-j377-6v63 activerecord (RubyGems) Fixed in 6.1.7.1 Advisory →
- Fix · GHSA-hq7p-j377-6v63 activerecord (RubyGems) Fixed in 7.0.4.1 Advisory →
Red Hat 1 advisory
- RHSA-2023:6818 Released 2023-11-08 · Red Hat rating ImportantSatellite 6.14 security and bug fix update
- Red Hat Satellite 6.14 for RHEL 8 foreman-3.7.0.9-1.el8sat, foreman-cli-3.7.0.9-1.el8sat, foreman-debug-3.7.0.9-1.el8sat +33
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Satellite 6.14 for RHEL 8 | Fixed | RHSA-2023:6818 |
Not affected: 1 product
- Red Hat Satellite 6.14 for RHEL 8
Timeline
- 2026-10-02 Threatist record created from CVE-2023-22794
- 2026-10-03 Alias added: GHSA-hq7p-j377-6v63
References
Other 6
- https://security.netapp.com/advisory/ntap-20240202-0008/
- https://github.com/rails/rails/commit/d7aba06953f9fa789c411676b941d20df8ef73de
- https://github.com/rails/rails
- https://github.com/rails/rails/releases/tag/v7.0.4.1
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2023-22794.yml
- https://security.netapp.com/advisory/ntap-20240202-0008
More Activerecord Project Activerecord vulnerabilities
- TI-2022-13933 Deserialization of untrusted data in https://github.com/rails/rails CVSS 3.1CRITICAL 9.8
- TI-2022-21907 Uncontrolled resource consumption in https://github.com/rails/rails CVSS 3.1HIGH 7.5
Sources
- CVE-2023-22794 · CVE Program
- CVE-2023-22794 · NVD
- FIRST EPSS
- GHSA-hq7p-j377-6v63 · GitHub Advisory Database · CC BY 4.0
- CVE-2023-22794 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences