CVE intelligence and bounded remediation
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
High
CVSS 8.8
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.
- Severity
- High
- CVSS
- 8.8 (3.1)
- Published
- 2023-02-09
- CISA KEV
- Not currently listed
- Ecosystem
- software/application
- Weaknesses
- CWE-89
Affected products
- activerecord_project / activerecord
Matched remediation archetype
SQL and data-query injection
This catalog composition supplies bounded fallback guidance. Explicitly reviewed curated workflows load with the complete record below.
Check exposure
- Trace request, message, file, and stored values into SQL, ORM query fragments, filters, sort expressions, and other data-query languages.
- Inventory database roles, reachable schemas, multi-tenant boundaries, and whether stacked or administrative operations are enabled.
- Check both direct queries and second-order use of previously stored values.
Remediate safely
- Use parameterized queries or safe query builders for all values; map identifiers and operators through explicit allowlists.
- Remove raw query concatenation and give the application account only the tables and operations it requires.
- Update affected data-access components and add regression tests for query structure preservation with inert edge-case inputs.
Authoritative sources
Complete CVE record and remediation plan
The detailed catalog view below loads this exact record, its source evidence, and the full seven-phase agentic change plan.