PT-2023-6422 · Unknown+3 · Active Record+3

Hmac

·

Published

2023-01-18

·

Updated

2025-09-29

·

CVE-2023-22794

CVSS v2.0

9.0

High

VectorAV:N/AC:L/Au:S/C:C/I:C/A:C
Name of the Vulnerable Software and Affected Versions ActiveRecord versions 6.0.0 through 6.0.6, versions 6.1.0 through 6.1.7, and versions 7.0.0 through 7.0.4
Description A vulnerability in ActiveRecord is related to the sanitization of comments, which may allow an attacker to inject SQL outside of the comment if malicious user input is passed to either the annotate query method, the optimizer hints query method, or through the QueryLogs interface. This could potentially lead to the execution of arbitrary code. Users should avoid passing user input to these methods.
Recommendations For versions 6.0.0 through 6.0.6, upgrade to version 6.0.6.1 or apply the patch 6-0-Make-sanitize as sql comment-more-strict.patch. For versions 6.1.0 through 6.1.7, upgrade to version 6.1.7.1 or apply the patch 6-1-Make-sanitize as sql comment-more-strict.patch. For versions 7.0.0 through 7.0.4, upgrade to version 7.0.4.1 or apply the patch 7-0-Make-sanitize as sql comment-more-strict.patch. As a temporary workaround, consider avoiding passing user input to the annotate and optimizer hints query methods, and restrict the use of QueryLogs configuration that can include user input.

Exploit

Fix

SQL injection

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALSA-2025_16880
ALT-PU-2023-1336
ALT-PU-2023-4268
ALT-PU-2024-7814
BDU:2023-07138
CVE-2023-22794
DSA-5372-1
GHSA-HQ7P-J377-6V63
OESA-2023-1132
OESA-2023-1133
OPENSUSE-SU-2024:12766-1
OPENSUSE-SU-2024:14069-1
OPENSUSE-SU-2025:15112-1
RHSA-2023:6818
RLSA-2023:6818
RLSA-2023_6818

Affected Products

Alt Linux
Active Record
Red Os
Rocky Linux