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.
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.
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 < CarrierWave::Uploader::Base
include CarrierWave::RMagick
end
[BREAKING CHANGE] Multiple file uploader now keeps successful files on update, only discarding failed ones(@mshibuya7db9195d)
[BREAKING CHANGE] #remote_#{column}_urls= was changed to preserve precedent updates(@mshibuya8f18a95b)
#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(@mshibuyaca201ee2)
CarrierWave::Uploader::Base#sanitized_file was deprecated, use #file instead(@mshibuya28190e99)
[BREAKING CHANGE] Multiple file uploader now keeps successful files on update, only discarding failed ones(@mshibuya7db9195d)
[BREAKING CHANGE] #remote_#{column}_urls= was changed to preserve precedent updates(@mshibuya8f18a95b)
#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(@mshibuyaca201ee2)
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)
Bumps carrierwave from 1.3.1 to 2.1.1. This update includes security fixes.
Vulnerabilities fixed
Sourced from The GitHub Security Advisory Database.
Sourced from The GitHub Security Advisory Database.
... (truncated)
Release notes
Sourced from carrierwave's releases.
Changelog
Sourced from carrierwave's changelog.
... (truncated)
Commits
003e2ce
Version 2.1.115bcf8d
Fix Code Injection vulnerability in CarrierWave::RMagicke0f79e3
Fix SSRF vulnerability in the remote file download feature3356634
Version 2.1.08964775
Merge pull request #2444 from inkoop/backblaze-private-bucket-support9a37fc9
Test against Ruby 2.73dfacea
backblaze authenticated_url spec addedcaf9018
merged mastere39194f
Merge pull request #2438 from jaredbeck/patch-221a0061
Merge pull request #2439 from Bonias/aws-use-proper-region-for-path-style-urlDependabot 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)