Active Record RCE bug with Serialized Columns
Date: 2022-07
Affected: rubygems/activerecord, rubygems/activerecord, rubygems/activerecord
Attack vector: deserialization
Category: vulnerability-disclosure
Severity: Critical
CVE: CVE-2022-32224
CWE: CWE-502
CVSS: 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

When serialized columns that use YAML (the default) are deserialized, Rails uses YAML.unsafe_load 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.


Mitigations:

Architectural layers (MAESTRO):