Cloudanix VulnDB

CVE-2022-32224

Critical · 9.8

CVSS

9.8

EPSS

2.6%

Published

Dec 5, 2022

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A flaw in older versions of the Ruby on Rails framework lets attackers who can change database contents take over the web server and run any commands they want.

Exploit Available Chainable
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Remote Code Execution
Component
Library
Class
Deserialization
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Unsafe YAML deserialization of attacker-controlled data stored in Active Record serialized columns allows instantiation of arbitrary Ruby objects and subsequent remote code execution.

Why it matters to the business

Attackers with database write access can achieve full application server takeover, leading to data theft, service disruption, or further lateral movement; the vulnerability is long-public with public exploits available, increasing risk for any unpatched Rails deployments using YAML serialization.

How an attack unfolds

An attacker first obtains the ability to write arbitrary data into a database column used for YAML serialization (commonly via SQL injection or compromised application credentials), places a malicious YAML payload containing a gadget chain that triggers code execution upon load, and then causes the application to load and deserialize the column during normal operation.

How to fix it

Upgrade Active Record to a fixed release: 7.0.3.1 or newer, 6.1.6.1 or newer, 6.0.5.1 or newer, or 5.2.8.1 or newer; apply the commit 8030cff808657faa44828de001cd3b80364597de in rails/rails and restart all application instances; avoid using YAML as a serialization format for any user-influenced data.

How to confirm the fix worked

Inventory all Rails applications and confirm Active Record version is at or above the listed fixed releases; search code and schema for uses of serialize :column, YAML and replace with safe alternatives; run dependency scanners against Gemfile.lock to verify no vulnerable rails versions remain.

Typical attack path

  1. Obtain database write capability through SQL injection or credential compromise
  2. Craft and insert a malicious YAML object into a serialized column
  3. Trigger application code path that performs YAML.load on the column
  4. Execute arbitrary Ruby code via the deserialized gadget chain
  5. Establish persistence or exfiltrate data from the compromised Rails process

How to detect it

Review application and database logs for unexpected changes to columns known to use YAML serialization; search process execution logs and Rails logs for evidence of YAML.load calls loading data that was recently modified via non-application paths; monitor for child processes spawned by the Rails application worker that are inconsistent with normal operation.

What your security team should do

  • Immediately upgrade all Rails applications to the patched Active Record versions listed in remediation guidance
  • Audit database columns used with YAML serialization and migrate to JSON or safe custom serializers
  • Implement web application firewall rules or input validation to block obvious SQL injection attempts that could lead to column manipulation
  • Enable and review Rails deserialization-related logging for anomalous object loads
  • Treat any application still on versions older than 5.2.8.1 as high priority for emergency patching given public exploit availability

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
RubyGems activerecord 0 5.2.8.1
RubyGems activerecord 6.0.0 6.0.5.1
RubyGems activerecord 6.1.0 6.1.6.1
RubyGems activerecord 7.0.0 7.0.3.1
Debian:11 rails 0 No fix
Debian:12 rails 0 2:6.1.6.1+dfsg-1
Debian:13 rails 0 2:6.1.6.1+dfsg-1
Red Hat:satellite:6.11::el7 candlepin 0 0:4.1.19-1.el7sat
Red Hat:satellite:6.11::el7 candlepin-selinux 0 0:4.1.19-1.el7sat
Red Hat:satellite:6.11::el7 foreman 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-cli 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-debug 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-dynflow-sidekiq 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-ec2 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-gce 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-journald 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-libvirt 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-openstack 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-ovirt 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-postgresql 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-service 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-telemetry 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 foreman-vmware 0 0:3.1.1.26-1.el7sat
Red Hat:satellite:6.11::el7 rubygem-foreman_maintain 0 1:1.0.19-1.el7sat
Red Hat:satellite:6.11::el7 satellite 0 0:6.11.5-1.el7sat
Red Hat:satellite:6.11::el7 satellite-capsule 0 0:6.11.5-1.el7sat
Red Hat:satellite:6.11::el7 satellite-cli 0 0:6.11.5-1.el7sat
Red Hat:satellite:6.11::el7 satellite-common 0 0:6.11.5-1.el7sat
Red Hat:satellite:6.11::el7 tfm-pulpcore-python-naya 0 0:1.1.1-1.1.el7pc
Red Hat:satellite:6.11::el7 tfm-pulpcore-python-pulp-container 0 0:2.9.9-1.el7pc
Red Hat:satellite:6.11::el7 tfm-pulpcore-python-pulpcore 0 0:3.16.15-1.el7pc
Red Hat:satellite:6.11::el7 tfm-pulpcore-python3-naya 0 0:1.1.1-1.1.el7pc
Red Hat:satellite:6.11::el7 tfm-pulpcore-python3-pulp-container 0 0:2.9.9-1.el7pc
Red Hat:satellite:6.11::el7 tfm-pulpcore-python3-pulpcore 0 0:3.16.15-1.el7pc
Red Hat:satellite:6.11::el7 tfm-rubygem-actioncable 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-actionmailbox 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-actionmailer 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-actionpack 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-actiontext 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-actionview 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-activejob 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-activemodel 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-activerecord 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-activestorage 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-activesupport 0 0:6.0.6-1.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-foreman_rh_cloud 0 0:5.0.44-1.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-foreman_theme_satellite 0 0:9.0.0.12-1.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-katello 0 0:4.3.0.52-1.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-rails 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-railties 0 0:6.0.6-2.el7sat
Red Hat:satellite:6.11::el7 tfm-rubygem-smart_proxy_container_gateway 0 0:1.0.7-1.el7sat
Red Hat:satellite:6.11::el8 candlepin 0 0:4.1.19-1.el8sat
Red Hat:satellite:6.11::el8 candlepin-selinux 0 0:4.1.19-1.el8sat
Red Hat:satellite:6.11::el8 foreman 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-cli 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-debug 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-dynflow-sidekiq 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-ec2 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-gce 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-journald 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-libvirt 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-openstack 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-ovirt 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-postgresql 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-service 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-telemetry 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 foreman-vmware 0 0:3.1.1.26-1.el8sat
Red Hat:satellite:6.11::el8 python-naya 0 0:1.1.1-1.1.el8pc
Red Hat:satellite:6.11::el8 python-pulp-container 0 0:2.9.9-1.el8pc
Red Hat:satellite:6.11::el8 python-pulpcore 0 0:3.16.15-1.el8pc
Red Hat:satellite:6.11::el8 python38-naya 0 0:1.1.1-1.1.el8pc
Red Hat:satellite:6.11::el8 python38-pulp-container 0 0:2.9.9-1.el8pc
Red Hat:satellite:6.11::el8 python38-pulpcore 0 0:3.16.15-1.el8pc
Red Hat:satellite:6.11::el8 rubygem-actioncable 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-actionmailbox 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-actionmailer 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-actionpack 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-actiontext 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-actionview 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-activejob 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-activemodel 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-activerecord 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-activestorage 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-activesupport 0 0:6.0.6-1.el8sat
Red Hat:satellite:6.11::el8 rubygem-foreman_maintain 0 1:1.0.19-1.el8sat
Red Hat:satellite:6.11::el8 rubygem-foreman_rh_cloud 0 0:5.0.44-1.el8sat
Red Hat:satellite:6.11::el8 rubygem-foreman_theme_satellite 0 0:9.0.0.12-1.el8sat
Red Hat:satellite:6.11::el8 rubygem-katello 0 0:4.3.0.52-1.el8sat
Red Hat:satellite:6.11::el8 rubygem-rails 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-railties 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.11::el8 rubygem-smart_proxy_container_gateway 0 0:1.0.7-1.el8sat
Red Hat:satellite:6.11::el8 satellite 0 0:6.11.5-1.el8sat
Red Hat:satellite:6.11::el8 satellite-capsule 0 0:6.11.5-1.el8sat
Red Hat:satellite:6.11::el8 satellite-cli 0 0:6.11.5-1.el8sat
Red Hat:satellite:6.11::el8 satellite-common 0 0:6.11.5-1.el8sat
Red Hat:satellite:6.12::el8 candlepin 0 0:4.1.18-1.el8sat
Red Hat:satellite:6.12::el8 candlepin-selinux 0 0:4.1.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-cli 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-debug 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-dynflow-sidekiq 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-ec2 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-gce 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-journald 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-libvirt 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-openstack 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-ovirt 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-postgresql 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-service 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-telemetry 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 foreman-vmware 0 0:3.3.0.18-1.el8sat
Red Hat:satellite:6.12::el8 python-pulp-container 0 0:2.10.10-1.el8pc
Red Hat:satellite:6.12::el8 python-pulp-rpm 0 0:3.18.9-1.el8pc
Red Hat:satellite:6.12::el8 python-pulpcore 0 0:3.18.11-1.el8pc
Red Hat:satellite:6.12::el8 python39-pulp-container 0 0:2.10.10-1.el8pc
Red Hat:satellite:6.12::el8 python39-pulp-rpm 0 0:3.18.9-1.el8pc
Red Hat:satellite:6.12::el8 python39-pulpcore 0 0:3.18.11-1.el8pc
Red Hat:satellite:6.12::el8 rubygem-actioncable 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-actionmailbox 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-actionmailer 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-actionpack 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-actiontext 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-actionview 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-activejob 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-activemodel 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-activerecord 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-activestorage 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-activesupport 0 0:6.0.6-1.el8sat
Red Hat:satellite:6.12::el8 rubygem-foreman_rh_cloud 0 0:6.0.44-1.el8sat
Red Hat:satellite:6.12::el8 rubygem-foreman_webhooks 0 0:3.0.5-1.1.el8sat
Red Hat:satellite:6.12::el8 rubygem-katello 0 0:4.5.0.22-1.el8sat
Red Hat:satellite:6.12::el8 rubygem-rails 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-railties 0 0:6.0.6-2.el8sat
Red Hat:satellite:6.12::el8 rubygem-smart_proxy_container_gateway 0 0:1.0.7-1.el8sat
Red Hat:satellite:6.12::el8 satellite 0 0:6.12.1-1.el8sat
Red Hat:satellite:6.12::el8 satellite-capsule 0 0:6.12.1-1.el8sat
Red Hat:satellite:6.12::el8 satellite-cli 0 0:6.12.1-1.el8sat
Red Hat:satellite:6.12::el8 satellite-common 0 0:6.12.1-1.el8sat
Red Hat:satellite:6.13::el8 ansible-collection-redhat-satellite 0 0:3.9.0-2.el8sat
Red Hat:satellite:6.13::el8 ansible-collection-redhat-satellite_operations 0 0:1.3.0-2.el8sat
Red Hat:satellite:6.13::el8 ansible-lint 0 0:5.0.8-4.el8pc
Red Hat:satellite:6.13::el8 ansible-runner 0 0:2.2.1-3.el8sat
Red Hat:satellite:6.13::el8 ansiblerole-foreman_scap_client 0 0:0.2.0-2.el8sat
Red Hat:satellite:6.13::el8 ansiblerole-insights-client 0 0:1.7.1-2.el8sat
Red Hat:satellite:6.13::el8 candlepin 0 0:4.2.13-1.el8sat
Red Hat:satellite:6.13::el8 candlepin-selinux 0 0:4.2.13-1.el8sat
Red Hat:satellite:6.13::el8 cjson 0 0:1.7.14-5.el8sat
Red Hat:satellite:6.13::el8 cjson-debuginfo 0 0:1.7.14-5.el8sat
Red Hat:satellite:6.13::el8 cjson-debugsource 0 0:1.7.14-5.el8sat
Red Hat:satellite:6.13::el8 createrepo_c 0 0:0.20.1-1.el8pc
Red Hat:satellite:6.13::el8 createrepo_c-debuginfo 0 0:0.20.1-1.el8pc
Red Hat:satellite:6.13::el8 createrepo_c-debugsource 0 0:0.20.1-1.el8pc
Red Hat:satellite:6.13::el8 createrepo_c-libs 0 0:0.20.1-1.el8pc
Red Hat:satellite:6.13::el8 createrepo_c-libs-debuginfo 0 0:0.20.1-1.el8pc
Red Hat:satellite:6.13::el8 dynflow-utils 0 0:1.6.3-1.el8sat
Red Hat:satellite:6.13::el8 foreman 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-bootloaders-redhat 0 0:202102220000-1.el8sat
Red Hat:satellite:6.13::el8 foreman-bootloaders-redhat-tftpboot 0 0:202102220000-1.el8sat
Red Hat:satellite:6.13::el8 foreman-cli 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-debug 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-discovery-image 0 1:4.1.0-10.el8sat
Red Hat:satellite:6.13::el8 foreman-discovery-image-service 0 0:1.0.0-4.1.el8sat
Red Hat:satellite:6.13::el8 foreman-discovery-image-service-tui 0 0:1.0.0-4.1.el8sat
Red Hat:satellite:6.13::el8 foreman-dynflow-sidekiq 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-ec2 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-installer 0 1:3.5.2.1-1.el8sat
Red Hat:satellite:6.13::el8 foreman-installer-katello 0 1:3.5.2.1-1.el8sat
Red Hat:satellite:6.13::el8 foreman-journald 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-libvirt 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-obsolete-packages 0 0:1.1-1.el8sat
Red Hat:satellite:6.13::el8 foreman-openstack 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-ovirt 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-postgresql 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-proxy 0 0:3.5.1-1.el8sat
Red Hat:satellite:6.13::el8 foreman-proxy-content 0 0:4.7.0-1.el8sat
Red Hat:satellite:6.13::el8 foreman-proxy-journald 0 0:3.5.1-1.el8sat
Red Hat:satellite:6.13::el8 foreman-selinux 0 0:3.5.1-1.el8sat
Red Hat:satellite:6.13::el8 foreman-service 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-telemetry 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 foreman-vmware 0 0:3.5.1.14-1.el8sat
Red Hat:satellite:6.13::el8 katello 0 0:4.7.0-1.el8sat
Red Hat:satellite:6.13::el8 katello-certs-tools 0 0:2.9.0-1.el8sat
Red Hat:satellite:6.13::el8 katello-client-bootstrap 0 0:1.7.9-1.el8sat
Red Hat:satellite:6.13::el8 katello-common 0 0:4.7.0-1.el8sat
Red Hat:satellite:6.13::el8 katello-debug 0 0:4.7.0-1.el8sat
Red Hat:satellite:6.13::el8 katello-selinux 0 0:4.0.2-2.el8sat
Red Hat:satellite:6.13::el8 libcomps 0 0:0.1.18-4.el8pc
Red Hat:satellite:6.13::el8 libcomps-debuginfo 0 0:0.1.18-4.el8pc
Red Hat:satellite:6.13::el8 libcomps-debugsource 0 0:0.1.18-4.el8pc
Red Hat:satellite:6.13::el8 libdb-cxx 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-cxx-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-debugsource 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-java-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-sql-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-sql-devel-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-tcl-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libdb-utils-debuginfo 0 0:5.3.28-42.el8_4
Red Hat:satellite:6.13::el8 libsodium 0 0:1.0.17-3.el8sat
Red Hat:satellite:6.13::el8 libsodium-debuginfo 0 0:1.0.17-3.el8sat

Related vulnerabilities