joatuapp / joatu-v2

The JoatU application, version 2. Written in Ruby on Rails.
https://alpha.joatu.org
GNU General Public License v3.0
27 stars 5 forks source link

[Security] Bump carrierwave from 1.3.1 to 2.1.1 #372

Closed dependabot-preview[bot] closed 3 years ago

dependabot-preview[bot] commented 3 years ago

Bumps carrierwave from 1.3.1 to 2.1.1. This update includes security fixes.

Vulnerabilities fixed

Sourced from The GitHub Security Advisory Database.

Server-side request forgery in CarrierWave

Impact

CarrierWave download feature has an SSRF vulnerability, allowing attacks to provide DNS entries or IP addresses that are intended for internal use and gather information about the Intranet infrastructure of the platform.

Patches

Upgrade to 2.1.1 or 1.3.2.

Workarounds

Using proper network segmentation and applying the principle of least privilege to outbound connections from application servers can reduce the severity of SSRF vulnerabilities. Ideally the vulnerable gem should run on an isolated server without access to any internal network resources or cloud metadata access.

References

Server-Side Request Forgery Prevention Cheat Sheet

For more information

If you have any questions or comments about this advisory:

Affected versions: < 1.3.2

Sourced from The GitHub Security Advisory Database.

Code Injection vulnerability in CarrierWave::RMagick

Impact

CarrierWave::RMagick has a Code Injection vulnerability. Its #manipulate! method inappropriately evals the content of mutation option(:read/:write), allowing attackers to craft a string that can be executed as a Ruby code. If an application developer supplies untrusted inputs to the option, it will lead to remote code execution(RCE).

(But supplying untrusted input to the option itself is dangerous even in absence of this vulnerability, since is prone to DoS vulnerability - attackers can try to consume massive amounts of memory by resizing to a very large dimension)

Proof of Concept

class MyUploader &lt; CarrierWave::Uploader::Base
  include CarrierWave::RMagick
end

MyUploader.new.manipulate!({ read: { density: "1 }; p 'Hacked'; {" }}) # =&gt; shows "Hacked"

Patches

Upgrade to 2.1.1 or 1.3.2.

Workarounds

Stop supplying untrusted input to #manipulate!'s mutation option.

... (truncated)

Affected versions: < 1.3.2

Release notes

Sourced from carrierwave's releases.

2.0.0.rc

Added

  • Append, reorder, and remove-single-file feature for multiple file uploader(@mshibuya #2401)
  • Allow retrieval of uploader index within uploaders(@mshibuya #1771)
  • Add ability to customize downloaders(@mshibuya #1636)
  • Support internationalized domain names for downloader(@mshibuya #2086)
  • Support authenticated_url for Aliyun provider(@Nitrino #2381)
  • Support passing options to authenticated_url for OpenStack provider(@stanhu #2377)
  • Support authenticated_url for AzureRM provider(@Nitrino #2375)
  • Allow custom expires_at when building an authenticated_url(@stephankaag #2397)

Changed

  • Use the storage given by storage configuration also for cache_storage unless explicitly specified(@mshibuya 629afecb)
  • Improve Fog initialization(@mshibuya #2395)
  • [BREAKING CHANGE] Multiple file uploader now keeps successful files on update, only discarding failed ones(@mshibuya 7db9195d)
  • [BREAKING CHANGE] #remote_#{column}_urls= was changed to preserve precedent updates(@mshibuya 8f18a95b)
  • #serializable_hash now returns string for version keys(@schovi #2246)
  • Use the MimeMagic gem to inspect file headers for the mime type. This allows for mitigation of CVE-2016-3714, in combination with a content_type_whitelist(@locriani #1934)
  • Replace mime-types dependency with mini_mime to save memory(@bradleypriest #2292)
  • Delegate MiniMagick processing to ImageProcessing gem(@janko #2298)
  • Handle ActiveRecord transaction correctly, not storing or removing files on rollback(@skosh #2209)

Deprecated

  • fog_provider configuration was deprecated and has no effect, just adding fog providers to Gemfile will load them(@mshibuya ca201ee2)
  • CarrierWave::Uploader::Base#sanitized_file was deprecated, use #file instead(@mshibuya 28190e99)

Removed

Fixed

Changelog

Sourced from carrierwave's changelog.

2.1.1 - 2021-02-08

Security

2.1.0 - 2020-02-16

Added

Fixed

  • Fix Ruby 2.7 deprecations(@mshibuya 9a37fc9e)
  • Fix S3 path-style URL for host with dots for buckets that are placed in other regions than us-east-1(@Bonias #2439)
  • Make MiniMagick::Image constant absolute to prevent misleading 'uninitialized constant' error(@p8 #2437)

2.0.2 - 2019-09-28

Fixed

2.0.1 - 2019-08-31

Fixed

2.0.0 - 2019-08-18

No changes.

2.0.0.rc - 2019-06-23

Added

  • Append, reorder, and remove-single-file feature for multiple file uploader(@mshibuya #2401)
  • Allow retrieval of uploader index within uploaders(@mshibuya #1771)
  • Add ability to customize downloaders(@mshibuya #1636)
  • Support internationalized domain names for downloader(@mshibuya #2086)
  • Support authenticated_url for Aliyun provider(@Nitrino #2381)
  • Support passing options to authenticated_url for OpenStack provider(@stanhu #2377)
  • Support authenticated_url for AzureRM provider(@Nitrino #2375)
  • Allow custom expires_at when building an authenticated_url(@stephankaag #2397)

Changed

  • [BREAKING CHANGE] Use the storage given by storage configuration also for cache_storage unless explicitly specified(@mshibuya 629afecb)
  • Improve Fog initialization(@mshibuya #2395)
  • [BREAKING CHANGE] Multiple file uploader now keeps successful files on update, only discarding failed ones(@mshibuya 7db9195d)
  • [BREAKING CHANGE] #remote_#{column}_urls= was changed to preserve precedent updates(@mshibuya 8f18a95b)
  • #serializable_hash now returns string for version keys(@schovi #2246)
  • Use the MimeMagic gem to inspect file headers for the mime type. This allows for mitigation of CVE-2016-3714, in combination with a content_type_whitelist(@locriani #1934)
  • Replace mime-types dependency with mini_mime to save memory(@bradleypriest #2292)
  • Delegate MiniMagick processing to ImageProcessing gem(@janko #2298)
  • Handle ActiveRecord transaction correctly, not storing or removing files on rollback(@skosh #2209)

Deprecated

  • fog_provider configuration was deprecated and has no effect, just adding fog providers to Gemfile will load them(@mshibuya ca201ee2)

... (truncated)

Commits
  • 003e2ce Version 2.1.1
  • 15bcf8d Fix Code Injection vulnerability in CarrierWave::RMagick
  • e0f79e3 Fix SSRF vulnerability in the remote file download feature
  • 3356634 Version 2.1.0
  • 8964775 Merge pull request #2444 from inkoop/backblaze-private-bucket-support
  • 9a37fc9 Test against Ruby 2.7
  • 3dfacea backblaze authenticated_url spec added
  • caf9018 merged master
  • e39194f Merge pull request #2438 from jaredbeck/patch-2
  • 21a0061 Merge pull request #2439 from Bonias/aws-use-proper-region-for-path-style-url
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)
dependabot-preview[bot] commented 3 years ago

Superseded by #374.