CVE-2023-22794

NameCVE-2023-22794
DescriptionA 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDSA-5372-1
Debian Bugs1030050

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
rails (PTS)jessie, jessie (lts)2:4.1.8-1+deb8u9vulnerable
stretch (security), stretch (lts), stretch2:4.2.7.1-1+deb9u5vulnerable
buster2:5.2.2.1+dfsg-1+deb10u3fixed
buster (security)2:5.2.2.1+dfsg-1+deb10u5fixed
bullseye (security), bullseye2:6.0.3.7+dfsg-2+deb11u2fixed
bookworm2:6.1.7.3+dfsg-1fixed
sid, trixie2:6.1.7.3+dfsg-3fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
railssourcejessie(unfixed)end-of-life
railssourcebuster(not affected)
railssourcebullseye2:6.0.3.7+dfsg-2+deb11u1DSA-5372-1
railssource(unstable)2:6.1.7.3+dfsg-11030050

Notes

[buster] - rails <not-affected> (Only affects 6.x and later)
https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117
https://github.com/rails/rails/commit/048e9fc05e18c91838a44e60175e475de8b2aad5 (6-1-stable)

Search for package or bug name: Reporting problems