CVE-2023-22794
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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 2:6.1.7.3+dfsg-1 |
| sid | Fixed | 2:6.1.7.3+dfsg-1 |
| forky | Fixed | 2:6.1.7.3+dfsg-1 |
| bullseye | Fixed | 2:6.0.3.7+dfsg-2+deb11u1 |
| bookworm | Fixed | 2:6.1.7.3+dfsg-1 |
Rocky Linux Fixed 1 release
| Version | Status | Fixed in |
|---|---|---|
| 8 | Fixed | โ |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| RubyGems | activerecord | !< 6.0.0||<~> 6.0.6, >= 6.0.6.1 | ~> 6.0.6, >= 6.0.6.1 |
| RubyGems | activerecord | >=6.0.0,<6.0.6.1 | 6.0.6.1 |
| RubyGems | activerecord | >=6.1.0,<6.1.7.1 | 6.1.7.1 |
| RubyGems | activerecord | >=7.0.0,<7.0.4.1 | 7.0.4.1 |
References
- https://github.com/rails/rails/releases/tag/v7.0.4.1
- https://errata.rockylinux.org/RLSA-2023:6818
- https://nvd.nist.gov/vuln/detail/CVE-2023-22794
- https://github.com/rails/rails/commit/d7aba06953f9fa789c411676b941d20df8ef73de
- https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117
- https://github.com/rails/rails
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2023-22794.yml
- https://security.netapp.com/advisory/ntap-20240202-0008
- https://www.debian.org/security/2023/dsa-5372
- https://security-tracker.debian.org/tracker/CVE-2023-22794
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.