Skip to content

Conversation

@depfu
Copy link
Contributor

@depfu depfu bot commented Jul 13, 2022


🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ activerecord (6.1.4.1 → 6.1.6.1) · Repo · Changelog

Security Advisories 🚨

🚨 Possible RCE escalation bug with Serialized Columns in Active Record

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.

In order to cope with that situation, the released version also contains two
new Active Record configuration options. The configuration options are as
follows:

  • config.active_storage.use_yaml_unsafe_load

When set to true, this configuration option tells Rails to use the old
"unsafe" YAML loading strategy, maintaining the existing behavior but leaving
the possible escalation vulnerability in place. Setting this option to true
is not recommended, but can aid in upgrading.

  • config.active_record.yaml_column_permitted_classes

The "safe YAML" loading method does not allow all classes to be deserialized
by default. This option allows you to specify classes deemed "safe" in your
application. For example, if your application uses Symbol and Time in
serialized data, you can add Symbol and Time to the allowed list as follows:

config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]

Workarounds

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

Release Notes

6.1.5.1 (from changelog)

  • No changes.

6.1.5 (from changelog)

  • Fix ActiveRecord::ConnectionAdapters::SchemaCache#deep_deduplicate for Ruby 2.6.

    Ruby 2.6 and 2.7 have slightly different implementations of the String#@- method. In Ruby 2.6, the receiver of the String#@- method is modified under certain circumstances. This was later identified as a bug (https://bugs.ruby-lang.org/issues/15926) and only fixed in Ruby 2.7.

    Before the changes in this commit, the ActiveRecord::ConnectionAdapters::SchemaCache#deep_deduplicate method, which internally calls the String#@- method, could also modify an input string argument in Ruby 2.6 -- changing a tainted, unfrozen string into a tainted, frozen string.

    Fixes #43056

    Eric O'Hanlon

  • Fix migration compatibility to create SQLite references/belongs_to column as integer when migration version is 6.0.

    reference/belongs_to in migrations with version 6.0 were creating columns as bigint instead of integer for the SQLite Adapter.

    Marcelo Lauxen

  • Fix dbconsole for 3-tier config.

    Eileen M. Uchitelle

  • Better handle SQL queries with invalid encoding.

    Post.create(name: "broken \xC8 UTF-8")

    Would cause all adapters to fail in a non controlled way in the code responsible to detect write queries.

    The query is now properly passed to the database connection, which might or might not be able to handle it, but will either succeed or failed in a more correct way.

    Jean Boussier

  • Ignore persisted in-memory records when merging target lists.

    Kevin Sjöberg

  • Fix regression bug that caused ignoring additional conditions for preloading has_many through relations.

    Fixes #43132

    Alexander Pauly

  • Fix ActiveRecord::InternalMetadata to not be broken by config.active_record.record_timestamps = false

    Since the model always create the timestamp columns, it has to set them, otherwise it breaks various DB management tasks.

    Fixes #42983

    Jean Boussier

  • Fix duplicate active record objects on inverse_of.

    Justin Carvalho

  • Fix duplicate objects stored in has many association after save.

    Fixes #42549.

    Alex Ghiculescu

  • Fix performance regression in CollectionAssocation#build.

    Alex Ghiculescu

  • Fix retrieving default value for text column for MariaDB.

    fatkodima

6.1.4.7 (from changelog)

  • No changes.

6.1.4.6 (from changelog)

  • No changes.

6.1.4.5 (from changelog)

  • No changes.

6.1.4.4 (from changelog)

  • No changes.

6.1.4.3 (from changelog)

  • No changes.

6.1.4.2 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

✳️ activesupport (6.1.4.1 → 6.1.6.1) · Repo · Changelog

Release Notes

6.1.5.1 (from changelog)

  • Fix and add protections for XSS in ActionView::Helpers and ERB::Util.

    Add the method ERB::Util.xml_name_escape to escape dangerous characters in names of tags and names of attributes, following the specification of XML.

    Álvaro Martín Fraguas

6.1.5 (from changelog)

  • Fix ActiveSupport::Duration.build to support negative values.

    The algorithm to collect the parts of the ActiveSupport::Duration ignored the sign of the value and accumulated incorrect part values. This impacted ActiveSupport::Duration#sum (which is dependent on parts) but not ActiveSupport::Duration#eql? (which is dependent on value).

    Caleb Buxton, Braden Staudacher

  • Time#change and methods that call it (eg. Time#advance) will now return a Time with the timezone argument provided, if the caller was initialized with a timezone argument.

    Fixes #42467.

    Alex Ghiculescu

  • Clone to keep extended Logger methods for tagged logger.

    Orhan Toy

  • assert_changes works on including ActiveSupport::Assertions module.

    Pedro Medeiros

6.1.4.7 (from changelog)

  • No changes.

6.1.4.6 (from changelog)

  • Fix Reloader method signature to work with the new Executor signature

6.1.4.5 (from changelog)

  • No changes.

6.1.4.4 (from changelog)

  • No changes.

6.1.4.3 (from changelog)

  • No changes.

6.1.4.2 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

✳️ minitest (5.15.0 → 5.16.2) · Repo · Changelog

Release Notes

5.16.2 (from changelog)

  • 4 bug fixes:

    • Added MT_KWARGS_HACK kludge for stub to deal with ruby 2.7 kwargs nastiness. (tsugimoto)

    • In #expect, pop Hash class from args if $MT_KWARGS_HACK. (casperisfine)

    • In above scenario, set expected kwargs (as Objects) based on actual kwargs.

    • Nuke ivars if exception fails to marshal twice (eg better_errors). (irphilli)

5.16.1 (from changelog)

  • 2 bug fixes:

    • Apparently adding real kwarg support to mocks/stubs broke some code. Fixed.

      • Use `MT_KWARGS_HACK=1` to activate the kludgy kwargs support w/ caveats.

    • Clarified some doco wrt the block on #stub.

5.16.0 (from changelog)

  • 2 major enhancements:

    • Added Minitest::TestTask.

    • Dropping ruby 2.2 - 2.5. 2.6 is DTM soon too.

  • 11 minor enhancements:

    • Added –show-skips option to show skips at end of run but not require –verbose. (MSP-Greg)

    • Added Minitest.seed, the random seed used by the run.

    • Calling `srand Minitest.seed` before all shuffles to ensure determinism.

    • Extended #stub to handle kwargs for both block and call args. (SampsonCrowley)

    • Extended Mock#__call to display kwargs.

    • Extended Mock#expect to record kwargs.

    • Extended Mock#method_missing to take kwargs & compare them against expected.

    • Mock#method_missing displays better errors on arity mismatch.

    • Removed minor optimization removing empty suites before run.

    • Simplified test randomization (test order will change even with fixed seed).

    • assert_match now returns the MatchData on success. (Nakilon)

  • 3 bug fixes:

    • (Re)Fixed marshalling of exceptions, neutering them in 2 passes.

    • Fixed more problems with rdoc.

    • Had to patch up mock and stub to deal with <=2.7 kwargs oddities

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 35 commits:

↗️ activemodel (indirect, 6.1.4.1 → 6.1.6.1) · Repo · Changelog

Release Notes

6.1.5.1 (from changelog)

  • No changes.

6.1.5 (from changelog)

  • Clear secure password cache if password is set to nil

    Before:

    user.password = 'something' user.password = nil

    user.password # => 'something'

    Now:

    user.password = 'something' user.password = nil

    user.password # => nil

    Markus Doits

  • Fix delegation in ActiveModel::Type::Registry#lookup and ActiveModel::Type.lookup

    Passing a last positional argument {} would be incorrectly considered as keyword argument.

    Benoit Daloze

  • Fix to_json after changes_applied for ActiveModel::Dirty object.

    Ryuta Kamizono

6.1.4.7 (from changelog)

  • No changes.

6.1.4.6 (from changelog)

  • No changes.

6.1.4.5 (from changelog)

  • No changes.

6.1.4.4 (from changelog)

  • No changes.

6.1.4.3 (from changelog)

  • No changes.

6.1.4.2 (from changelog)

  • No changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ concurrent-ruby (indirect, 1.1.9 → 1.1.10) · Repo · Changelog

Release Notes

1.1.10

concurrent-ruby:

  • (#951) Set the Ruby compatibility version at 2.2
  • (#939, #933) The caller_runs fallback policy no longer blocks reads from the job queue by worker threads
  • (#938, #761, #652) You can now explicitly prune_pool a thread pool (Sylvain Joyeux)
  • (#937, #757, #670) We switched the Yahoo stock API for demos to Alpha Vantage (Gustavo Caso)
  • (#932, #931) We changed how SafeTaskExecutor handles local jump errors (Aaron Jensen)
  • (#927) You can use keyword arguments in your initialize when using Async (Matt Larraz)
  • (#926, #639) We removed timeout from TimerTask because it wasn't sound, and now it's a no-op with a warning (Jacob Atzen)
  • (#919) If you double-lock a re-entrant read-write lock, we promote to locked for writing (zp yuan)
  • (#915) monotonic_time now accepts an optional unit parameter, as Ruby's clock_gettime (Jean Boussier)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ i18n (indirect, 1.8.10 → 1.11.0) · Repo · Changelog

Release Notes

1.11.0

What's Changed

New Contributors

Full Changelog: v1.10.0...v1.11.0

1.10.0

What's Changed

New Features

Bug fixes

Other changes

  • Remove pry from Gemfile as it is not used by @dvzrv in #608

New Contributors

Full Changelog: v1.9.1...v1.10.0

1.9.1

What's Changed

Full Changelog: v1.9.0...v1.9.1

1.9.0

Minor version bump: The number of changes in this release are more than I would feel comfortable including in a point release. Therefore, I have bumped the minor version number here. -- @radar

What's Changed

New Contributors

Full Changelog: v1.8.11...v1.9.0

1.8.11

What's Changed

New Contributors

Full Changelog: v1.8.10...v1.8.11

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ zeitwerk (indirect, 2.4.2 → 2.6.0) · Repo · Changelog

Release Notes

2.6.0 (from changelog)

  • Directories are processed in lexicographic order.

    Different file systems may list directories in different order, and with this change we ensure that client code eager loads consistently across platforms, for example.

  • Before this release, subdirectories of root directories always represented namespaces (unless ignored or collapsed). From now on, to be considered namespaces they also have to contain at least one non-ignored Ruby file with extension .rb, directly or recursively.

    If you know beforehand a certain directory or directory pattern does not represent a namespace, it is intentional and more efficient to tell Zeitwerk to ignore it.

    However, if you don't do so and have a directory tasks that only contains Rake files, arguably that directory is not meant to represent a Ruby module. Before, Zeitwerk would define a top-level Tasks module after it; now, it does not.

    This feature is also handy for projects that have directories with auxiliary resources mixed in the project tree in a way that is too dynamic for an ignore pattern to be practical. See #216.

    In the unlikely case that an existing project has an empty directory for the sole purpose of defining a totally empty module (no code, and no nested classes or modules), such module has now to be defined in a file.

    Directories are scanned again on reloads.

  • On setup, loaders created with Zeitwerk::Loader.for_gem issue warnings if lib has extra, non-ignored Ruby files or directories.

    This is motivated by existing gems with directories under lib that are not meant to define Ruby modules, like directories for Rails generators, for instance.

    This warning can be silenced in the unlikely case that the extra stuff is actually autoloadable and has to be managed by Zeitwerk.

    Please, check the documentation for further details.

    This method returns an instance of a private subclass of Zeitwerk::Loader now, but you cannot rely on the type, just on the interface.

2.5.4 (from changelog)

  • If a file did not define the expected constant, there was a reload, and there were on_unload callbacks, Zeitwerk still tried to access the constant during reload, which raised. This has been corrected.

2.5.3 (from changelog)

  • The change introduced in 2.5.2 implied a performance regression that was particularly dramatic in Ruby 3.1. We'll address #198 in a different way.

2.5.1 (from changelog)

  • Restores support for namespaces that are not hashable. For example namespaces that override the hash method with a different arity as shown in #188.

2.5.0 (from changelog)

Breaking changes

  • Requires Ruby 2.5.

  • Deletes the long time deprecated preload API. Instead of:

    loader.preload("app/models/user.rb")

    just reference the constant on setup:

    loader.on_setup { User }

    If you want to eager load a namespace, use the constants API:

    loader.on_setup do
      Admin.constants(false).each { |cname| Admin.const_get(cname) }
    end

Bug fixes

  • Fixes a bug in which a certain valid combination of overlapping trees managed by different loaders and ignored directories was mistakenly reported as having conflicting directories.

  • Detects external namespaces defined with Module#autoload. If your project reopens a 3rd party namespace, Zeitwerk already detected it and did not consider the namespace to be managed by the loader (automatically descends, ignored for reloads, etc.). However, the loader did not do that if the namespace had only an autoload in the 3rd party code yet to be executed. Now it does.

Callbacks

  • Implements Zeitwerk::Loader#on_setup, which allows you to configure blocks of code to be executed on setup and on each reload. When the callback is fired, the loader is ready, you can refer to project constants in the block.

    See the documentation for further details.

  • There is a new catch-all Zeitwerk::Loader#on_load that takes no argument and is triggered for all loaded objects:

    loader.on_load do |cpath, value, abspath|
      # ...
    end

    Please, remember that if you want to trace the activity of a loader, Zeitwerk::Loader#log! logs plenty of information.

    See the documentation for further details.

  • The block of the existing Zeitwerk::Loader#on_load receives also the value stored in the constant, and the absolute path to its corresponding file or directory:

    loader.on_load("Service::NotificationsGateway") do |klass, abspath|
      # ...
    end

    Remember that blocks can be defined to take less arguments than passed. So this change is backwards compatible. If you had

    loader.on_load("Service::NotificationsGateway") do
      Service::NotificationsGateway.endpoint = ...
    end

    That works.

  • Implements Zeitwerk::Loader#on_unload, which allows you to configure blocks of code to be executed before a certain class or module gets unloaded:

    loader.on_unload("Country") do |klass, _abspath|
      klass.clear_cache
    end

    These callbacks are invoked during unloading, which happens in an unspecified order. Therefore, they should not refer to reloadable constants.

    You can also be called for all unloaded objects:

    loader.on_unload do |cpath, value, abspath|
      # ...
    end

    Please, remember that if you want to trace the activity of a loader, Zeitwerk::Loader#log! logs plenty of information.

    See the documentation for further details.

Assorted

  • Performance improvements.

  • Documentation improvements.

  • The method Zeitwerk::Loader#eager_load accepts a force flag:

    loader.eager_load(force: true)

    If passed, eager load exclusions configured with do_not_eager_load are not honoured (but ignored files and directories are).

    This may be handy for test suites that eager load in order to ensure all files define the expected constant.

  • Eliminates internal use of File.realpath. One visible consequence is that in logs root dirs are shown as configured if they contain symlinks.

  • When an autoloaded file does not define the expected constant, Ruby clears state differently starting with Ruby 3.1. Unloading has been revised to be compatible with both behaviours.

  • Logging prints a few new traces.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Jul 13, 2022
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit f78ac70 and detected 0 issues on this pull request.

View more on Code Climate.

@depfu
Copy link
Contributor Author

depfu bot commented Jan 20, 2023

Closed in favor of #53.

@depfu depfu bot closed this Jan 20, 2023
@depfu depfu bot deleted the depfu/update/group/rails-6.1.6.1 branch January 20, 2023 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant