CVE-2023-22794
Ruby packages · CVE-2023-22794
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.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 2.153% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T17:28:52.703Z. Public exploit availability is not used to set this status.
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T17:28:52.703Z | CISA KEV |
| cvss | unknown | unknown | unknown |
| epss | verified | 2026-11-19T16:04:35.920Z | FIRST EPSS |
| patches | verified | 2026-11-19T12:52:44.805Z | OSV |
| affected | verified | 2026-11-19T12:56:47.422Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:56:47.422Z | CVE Program |
Affected versions and configuration
n/a https://github.com/rails/rails; default status: unknown: 6.0.6.1, 6.1.7.1, 7.0.4.1 [affected; scheme: unspecified]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
CVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "n/a",
"product": "https://github.com/rails/rails",
"versions": [
{
"status": "affected",
"version": "6.0.6.1, 6.1.7.1, 7.0.4.1"
}
]
}
],
"additionalContainers": [
{
"title": "CVE Program Container",
"references": [
{
"url": "https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117",
"tags": [
"x_transferred"
]
},
{
"url": "https://www.debian.org/security/2023/dsa-5372",
"name": "DSA-5372",
"tags": [
"vendor-advisory",
"x_transferred"
]
},
{
"url": "https://security.netapp.com/advisory/ntap-20240202-0008/",
"tags": [
"x_transferred"
]
}
],
"providerMetadata": {
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE",
"dateUpdated": "2024-08-02T10:20:30.748Z"
}
}
]
}Archived source JSONOSV · osv · full conditions
{
"id": "GHSA-hq7p-j377-6v63",
"aliases": [
"CVE-2023-22794"
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.0.0"
},
{
"fixed": "6.0.6.1"
}
]
}
],
"package": {
"name": "activerecord",
"purl": "pkg:gem/activerecord",
"ecosystem": "RubyGems"
},
"versions": [
"6.0.0",
"6.0.1",
"6.0.1.rc1",
"6.0.2",
"6.0.2.1",
"6.0.2.2",
"6.0.2.rc1",
"6.0.2.rc2",
"6.0.3",
"6.0.3.1",
"6.0.3.2",
"6.0.3.3",
"6.0.3.4",
"6.0.3.5",
"6.0.3.6",
"6.0.3.7",
"6.0.3.rc1",
"6.0.4",
"6.0.4.1",
"6.0.4.2",
"6.0.4.3",
"6.0.4.4",
"6.0.4.5",
"6.0.4.6",
"6.0.4.7",
"6.0.4.8",
"6.0.5",
"6.0.5.1",
"6.0.6"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/01/GHSA-hq7p-j377-6v63/GHSA-hq7p-j377-6v63.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.1.0"
},
{
"fixed": "6.1.7.1"
}
]
}
],
"package": {
"name": "activerecord",
"purl": "pkg:gem/activerecord",
"ecosystem": "RubyGems"
},
"versions": [
"6.1.0",
"6.1.1",
"6.1.2",
"6.1.2.1",
"6.1.3",
"6.1.3.1",
"6.1.3.2",
"6.1.4",
"6.1.4.1",
"6.1.4.2",
"6.1.4.3",
"6.1.4.4",
"6.1.4.5",
"6.1.4.6",
"6.1.4.7",
"6.1.5",
"6.1.5.1",
"6.1.6",
"6.1.6.1",
"6.1.7"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/01/GHSA-hq7p-j377-6v63/GHSA-hq7p-j377-6v63.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "7.0.0"
},
{
"fixed": "7.0.4.1"
}
]
}
],
"package": {
"name": "activerecord",
"purl": "pkg:gem/activerecord",
"ecosystem": "RubyGems"
},
"versions": [
"7.0.0",
"7.0.1",
"7.0.2",
"7.0.2.1",
"7.0.2.2",
"7.0.2.3",
"7.0.2.4",
"7.0.3",
"7.0.3.1",
"7.0.4"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/01/GHSA-hq7p-j377-6v63/GHSA-hq7p-j377-6v63.json"
}
}
],
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"upstream": [],
"withdrawn": null,
"references": [
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-22794",
"type": "ADVISORY"
},
{
"url": "https://github.com/rails/rails/commit/d7aba06953f9fa789c411676b941d20df8ef73de",
"type": "WEB"
},
{
"url": "https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117",
"type": "WEB"
},
{
"url": "https://github.com/rails/rails",
"type": "PACKAGE"
},
{
"url": "https://github.com/rails/rails/releases/tag/v7.0.4.1",
"type": "WEB"
},
{
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2023-22794.yml",
"type": "WEB"
},
{
"url": "https://security.netapp.com/advisory/ntap-20240202-0008",
"type": "WEB"
},
{
"url": "https://www.debian.org/security/2023/dsa-5372",
"type": "WEB"
}
],
"relatedGitRanges": [],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"severity": "HIGH",
"github_reviewed": true,
"nvd_published_at": "2023-02-09T20:15:00Z",
"github_reviewed_at": "2023-01-18T18:20:19Z"
}
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| ecosystem-boundary | RubyGems / package | activerecord | Not a distribution channel | 6.0.6.1 | Official record |
| ecosystem-boundary | RubyGems / package | activerecord | Not a distribution channel | 6.1.7.1 | Official record |
| ecosystem-boundary | RubyGems / package | activerecord | Not a distribution channel | 7.0.4.1 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- OSVConsulted: 2026-11-19T12:52:44.805ZArchived source JSON
Source publication: 2023-01-18T18:20:19.000Z
Source modification: 2024-02-21T05:41:43.535ZDocument fingerprint
5aabea5574f8b18817c51908dfbdffe1875008669e22e0b5d3b4151bd0455fae - CISA KEVConsulted: 2026-11-19T17:28:52.703ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - CVE ProgramConsulted: 2026-11-19T12:56:47.422ZArchived source JSON
Source publication: 2023-02-09T00:00:00.000Z
Source modification: 2024-08-02T10:20:30.748ZDocument fingerprint
16fa958915b5d0c06edbf6c0cda37aaf33a9af66febcd90ef1a1efa7e1c9c2fa - FIRST EPSSConsulted: 2026-11-19T16:04:35.920ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
e984bc4a8ff3b06285e2eddb70222ac8a60d7c809f73be8fc1d22065f95250ad
Official status history
- UNKNOWN → PUBLISHED · · evidence