Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 857840 (CVE-2022-32224) - <dev-ruby/rails-{5.2.8.1,6.0.5.1,6.1.6.1,7.0.3.1}: Possible RCE escalation bug with Serialized Columns in Active Record
Summary: <dev-ruby/rails-{5.2.8.1,6.0.5.1,6.1.6.1,7.0.3.1}: Possible RCE escalation bu...
Status: IN_PROGRESS
Alias: CVE-2022-32224
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: https://discuss.rubyonrails.org/t/cve...
Whiteboard: B2 [glsa?]
Keywords:
Depends on: 858689
Blocks:
  Show dependency tree
 
Reported: 2022-07-13 05:18 UTC by Hans de Graaff
Modified: 2022-07-21 22:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans de Graaff gentoo-dev Security 2022-07-13 05:18:47 UTC
There is a possible escalation to RCE when using YAML serialized columns in Active Record. This vulnerability has been assigned the CVE identifier CVE-2022-32224.

Versions Affected: All. Not affected: None Fixed Versions: 7.0.3.1, 6.1.6.1, 6.0.5.1, 5.2.8.1
Impact

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.

Impacted Active Record models will look something like this:

class User < ApplicationRecord
  serialize :options       # Vulnerable: Uses YAML for serialization
  serialize :values, Array # Vulnerable: Uses YAML for serialization
  serialize :values, JSON  # Not vulnerable
end

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.

The released versions change the default YAML deserializer to use YAML.safe_load, which prevents deserialization of possibly dangerous objects. This may introduce backwards compatibility issues with existing data.
Comment 1 Hans de Graaff gentoo-dev Security 2022-07-13 07:11:55 UTC
Fixed versions 7.0.3.1, 6.1.6.1, 6.0.5.1, 5.2.8.1 have been added.
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-07-13 17:56:23 UTC
Thanks! Please stable when ready.
Comment 3 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-07-19 21:14:46 UTC
Please cleanup
Comment 4 Hans de Graaff gentoo-dev Security 2022-07-20 07:37:27 UTC
Cleanup done.
Comment 5 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-07-21 22:30:34 UTC
Thanks!