CVE-2022-32224: SQL Injection

Published Jul 12, 2022
·
Updated

A possible escalation to RCE vulnerability exists when using YAML serialized columns in Active Record < 7.0.3.1, <6.1.6.1, <6.0.5.1 and <5.2.8.1 which could allow an attacker, that can manipulate data in the database (via means like SQL injection), the ability to escalate to an RCE.

Other sources

There is a possible escalation to RCE when using YAML serialized columns in Active Record. When serialized columns that use YAML (the default) are deserialized, Rails uses YAML.unsafeload to convert the YAML data in to Ruby objects. If an attacker can manipulate data in the database (via means like SQL injection), then it may be possible for the attacker to escalate to an RCE.

— Red Hat

When serialized columns that use YAML (the default) are deserialized, Rails uses YAML.unsafeload to convert the YAML data in to Ruby objects. If an attacker can manipulate data in the database (via means like SQL injection), then it may be possible for the attacker to escalate to an RCE.

There are no feasible workarounds for this issue, but other coders (such as JSON) are not impacted.

— GitHub

Affected Software

16 affected componentsFixes available
redhat/rubygem-activerecord<7.0.3.1
7.0.3.1
redhat/rubygem-activerecord<6.1.6.1
6.1.6.1
redhat/rubygem-activerecord<6.0.5.1
6.0.5.1
redhat/rubygem-activerecord<5.2.8.1
5.2.8.1
Activerecord Project Activerecord Ruby<5.2.8.1
Activerecord Project Activerecord Ruby>=6.0.0<6.0.5.1
Activerecord Project Activerecord Ruby>=6.1.0<6.1.6.1
Activerecord Project Activerecord Ruby>=7.0.0<7.0.3.1
rubygems/activerecord<=5.2.8
5.2.8.1
rubygems/activerecord>=6.0.0<=6.0.5
6.0.5.1
rubygems/activerecord>=6.1.0<=6.1.6
6.1.6.1
rubygems/activerecord>=7.0.0<=7.0.3
7.0.3.1
debian/rails<2:6.1.6.1+dfsg-1
2:6.1.6.1+dfsg-1
debian/rails<2:6.1.6.1+dfsg-1
2:6.1.6.1+dfsg-1
debian/rails<2:6.1.6.1+dfsg-1
2:6.1.6.1+dfsg-1
debian/rails
2:6.1.7.10+dfsg-1~deb12u22:6.1.7.10+dfsg-1~deb12u32:7.2.2.2+dfsg-2~deb13u12:7.2.2.2+dfsg-2~deb13u22:7.2.4+dfsg-12:7.2.4+dfsg-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/rubygem-activerecord to a version that resolves this vulnerability.

    Fixed in 7.0.3.1
  2. Upgrade

    Upgrade redhat/rubygem-activerecord to a version that resolves this vulnerability.

    Fixed in 6.1.6.1
  3. Upgrade

    Upgrade redhat/rubygem-activerecord to a version that resolves this vulnerability.

    Fixed in 6.0.5.1
  4. Upgrade

    Upgrade redhat/rubygem-activerecord to a version that resolves this vulnerability.

    Fixed in 5.2.8.1
  5. Upgrade

    Upgrade debian/rails to a version that resolves this vulnerability.

    Fixed in 2:6.1.7.10+dfsg-1~deb12u2Fixed in 2:6.1.7.10+dfsg-1~deb12u3Fixed in 2:7.2.2.2+dfsg-2~deb13u1Fixed in 2:7.2.2.2+dfsg-2~deb13u2Fixed in 2:7.2.4+dfsg-1Fixed in 2:7.2.4+dfsg-2
  6. Upgrade

    Upgrade rubygems/activerecord to a version that resolves this vulnerability.

    Fixed in 5.2.8.1
  7. Upgrade

    Upgrade rubygems/activerecord to a version that resolves this vulnerability.

    Fixed in 6.0.5.1
  8. Upgrade

    Upgrade rubygems/activerecord to a version that resolves this vulnerability.

    Fixed in 6.1.6.1
  9. Upgrade

    Upgrade rubygems/activerecord to a version that resolves this vulnerability.

    Fixed in 7.0.3.1
  10. Upgrade

    Upgrade debian/rails to a version that resolves this vulnerability.

    Fixed in 2:6.1.6.1+dfsg-1
  11. Upgrade

    Upgrade Active Record to a version that resolves this vulnerability.

    Fixed in 7.0.3.1
  12. Upgrade

    Upgrade Active Record to a version that resolves this vulnerability.

    Fixed in 6.1.6.1
  13. Upgrade

    Upgrade Active Record to a version that resolves this vulnerability.

    Fixed in 6.0.5.1
  14. Upgrade

    Upgrade Active Record to a version that resolves this vulnerability.

    Fixed in 5.2.8.1

Event History

Jul 12, 2022
Advisory Published
via GitHub·07:39 PM
Data Sourced
via GitHub·07:39 PM
DescriptionSeverityWeaknessAffected Software
Jul 17, 2022
Exploit Published
via GitHub·04:09 AM
Dec 5, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·10:15 PM
DescriptionSeverityAffected Software

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-32224?

CVE-2022-32224 is a vulnerability that allows for a possible escalation to RCE (Remote Code Execution) when using YAML serialized columns in Active Record in Ruby on Rails.

2

How does the vulnerability work?

When serialized columns that use YAML are deserialized, Rails uses YAML.unsafe_load to convert the YAML data into Ruby objects. An attacker who can manipulate data in the database could potentially exploit this and escalate to an RCE.

3

What is the severity of CVE-2022-32224?

CVE-2022-32224 has a severity rating of critical with a severity value of 9.

4

Which versions of Rubygem ActiveRecord are affected by CVE-2022-32224?

Versions up to and excluding 7.0.3.1, 6.1.6.1, 6.0.5.1, and 5.2.8.1 are affected by CVE-2022-32224.

5

How do I fix CVE-2022-32224?

To fix CVE-2022-32224, it is recommended to update to version 7.0.3.1, 6.1.6.1, 6.0.5.1, or 5.2.8.1 of Rubygem ActiveRecord, depending on the version you are currently using.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203