GitHub Advisoryadvisory · RubyGems
GHSA-hq7p-j377-6v63 SQL Injection Vulnerability via ActiveRecord comments
HIGH
Official page ↗
- Aliases
- CVE-2023-22794
- Ecosystem
- RubyGems
- Packages
- activerecord
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-89
- Reviewed
- 2023-01-18
Affected packages
• RubyGems activerecord: >= 6.0.0, < 6.0.6.1 → fixed in 6.0.6.1
• RubyGems activerecord: >= 6.1.0, < 6.1.7.1 → fixed in 6.1.7.1
• RubyGems activerecord: >= 7.0.0, < 7.0.4.1 → fixed in 7.0.4.1
Description
There is a possible vulnerability in ActiveRecord related to the sanitization of comments. This vulnerability has been assigned the CVE identifier CVE-2023-22794.
Versions Affected: >= 6.0.0 Not affected: { }
}
]
```
All users running an affected release should either upgrade or use one of the workarounds immediately.
Releases
The FIXED releases are available at the normal locations.
Workarounds
Avoid passing user input to annotate and avoid using QueryLogs configuration which can include user input.
Patches
To aid users who aren’t able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
6-0-Make-sanitize_as_sql_comment-more-strict.patch - Patch for 6.0 series
6-1-Make-sanitize_as_sql_comment-more-strict.patch - Patch for 6.1 series
7-0-Make-sanitize_as_sql_comment-more-strict.patch - Patch for 7.0 series
Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.
Related
Alias · CVE (1)
- 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. vulnerability
Weakness · CWE (1)
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2023-22794 advisory
- https://github.com/rails/rails/commit/d7aba06953f9fa789c411676b941d20df8ef73de web
- https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117 web
- https://github.com/rails/rails package
- https://github.com/rails/rails/releases/tag/v7.0.4.1 web
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord/CVE-2023-22794.yml web
- https://security.netapp.com/advisory/ntap-20240202-0008 web
- https://www.debian.org/security/2023/dsa-5372 web