1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/core_ext
Aaron Lipman 722c45f641 Omit marshal_dump & _dump from delegate_missing_to
Exclude missing marshal_dump and _dump methods from being delegated to
an object's delegation target via the delegate_missing_to extension.
This avoids unintentionally adding instance variables to an object
during marshallization, should the delegation target be a method which
would otherwise add them.

In current versions of Ruby, a bug exists in the way objects are
marshalled, allowing for instance variables to be added or removed
during marshallization (see https://bugs.ruby-lang.org/issues/15968).
This results in a corrupted serialized byte stream, causing an object's
instance variables to "leak" into subsequent serialized objects during
demarshallization.

In Rails, this behavior may be triggered when marshalling an object that
uses the delegate_missing_to extension, if the delegation target is a
method which adds or removes instance variables to an object being
marshalled - when calling Marshal.dump(object), Ruby's built in behavior
will check whether the object responds to :marshal_dump or :_dump, which
in turn triggers the delegation target method in the
responds_to_missing? function defined in
activesupport/lib/active_support/core_ext/module/delegation.rb

While future versions of Ruby will resolve this bug by raising a
RuntimeError, the underlying cause of this error may not be readily
apparent when encountered by Rails developers. By excluding marshal_dump
and _dump from being delegated to an object's target, this commit
eliminates a potential cause of unexpected behavior and/or
RuntimeErrors.

Fixes #36522
2019-07-17 23:22:39 -04:00
..
array Fix including/excluding flattening 2019-03-06 13:34:04 -03:00
class [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
digest [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
hash Delete uneeded blank file 2019-02-08 12:30:45 -05:00
kernel [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
module Remove deprecated Module#reachable? method 2019-01-17 16:08:34 -05:00
object Implement UnboundMethod#duplicable? 2019-07-12 10:47:23 +02:00
bigdecimal_test.rb Suppress warning: BigDecimal.new is deprecated 2017-12-15 01:19:57 +00:00
class_test.rb Change refute to assert_not 2018-01-25 23:32:58 -05:00
date_and_time_behavior.rb Delete DateAndTime method definition in rails that is compatible with ruby definition 2019-06-16 18:11:39 +09:00
date_and_time_compatibility_test.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
date_ext_test.rb Delete DateAndTime method definition in rails that is compatible with ruby definition 2019-06-16 18:11:39 +09:00
date_time_ext_test.rb Fix issue where duration where always rounded up to a second: 2018-10-12 13:27:13 -04:00
duration_test.rb Add tests for duration multiplication and division 2018-06-25 13:48:35 +01:00
enumerable_test.rb Fix including/excluding flattening 2019-03-06 13:34:04 -03:00
file_test.rb Ensure correct permission when tmpdir is the same as dirname. 2018-10-02 16:40:39 +02:00
hash_ext_test.rb Fix rubocop violations 2019-02-09 10:50:58 +09:00
integer_ext_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
kernel_test.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
load_error_test.rb Fixes warning: mismatched indentations at 'rescue' with 'def' at 15. 2018-12-21 12:28:33 +01:00
marshal_test.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
module_test.rb Omit marshal_dump & _dump from delegate_missing_to 2019-07-17 23:22:39 -04:00
name_error_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
numeric_ext_test.rb Deprecate "active_support/core_ext/numeric/inquiry" 2018-03-02 23:32:10 -08:00
range_ext_test.rb Fix bug in Range comparisons when comparing to excluded-end Range 2019-03-28 00:57:05 +00:00
regexp_ext_test.rb Remove test_match_p since Rails 6 requires Ruby 2.4.1 or newer 2018-05-07 04:19:24 +09:00
secure_random_test.rb Tweak test name 2018-12-30 12:01:55 -05:00
string_ext_test.rb Frozen truncate (#36109) 2019-04-26 13:29:41 -04:00
time_ext_test.rb Delete DateAndTime method definition in rails that is compatible with ruby definition 2019-06-16 18:11:39 +09:00
time_with_zone_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
uri_ext_test.rb URI.unescape handles mixed Unicode/escaped input 2018-03-07 12:58:02 +11:00