# CVE-2023-22794: rails: A vulnerability in ActiveRecord <6.0.6.1, v6.1.7.1 and v7.0.4.1 related to the sanitization of comments

CVE-2023-22794 is fixed in rails on 1 platform, first by DEBIAN-CVE-2023-22794, released February 9, 2023. It is not reported as exploited. Patch Radar priority: High.

- Web page: https://patchblox.com/security/cve/CVE-2023-22794
- Priority: High
- CVSS: 8.8 (high)
- EPSS: 0.0215
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Feb 9, 2023

## 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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | rails Debian 12.15 (bookworm) | 2:6.1.7.3+dfsg-1 | [DEBIAN-CVE-2023-22794](https://patchblox.com/security/data/fix/linux/debian-cve-2023-22794.md) | Feb 9, 2023 |
| Linux | rails Debian 13.5 (trixie) | 2:6.1.7.3+dfsg-1 | [DEBIAN-CVE-2023-22794](https://patchblox.com/security/data/fix/linux/debian-cve-2023-22794.md) | Feb 9, 2023 |
| Linux | rails Debian 14 | 2:6.1.7.3+dfsg-1 | [DEBIAN-CVE-2023-22794](https://patchblox.com/security/data/fix/linux/debian-cve-2023-22794.md) | Feb 9, 2023 |

---

Data as of 2026-11-08T19:12:23Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
