Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚨 [security] Update carrierwave 2.2.2 → 2.2.6 (patch) #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

depfu[bot]
Copy link

@depfu depfu bot commented Mar 27, 2024


Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 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?

✳️ carrierwave (2.2.2 → 2.2.6) · Repo · Changelog

Security Advisories 🚨

🚨 CarrierWave content-Type allowlist bypass vulnerability which possibly leads to XSS remained

Impact

The vulnerability CVE-2023-49090
wasn't fully addressed.

This vulnerability is caused by the fact that when uploading to
object storage, including Amazon S3, it is possible to set a
Content-Type value that is interpreted by browsers to be different
from what's allowed by content_type_allowlist, by providing
multiple values separated by commas.

This bypassed value can be used to cause XSS.

Patches

Upgrade to 3.0.7 or 2.2.6.

Workarounds

Use the following monkey patch to let CarrierWave parse the
Content-type by using Marcel::MimeType.for.

# For CarrierWave 3.x
CarrierWave::SanitizedFile.class_eval do
  def declared_content_type
    @declared_content_type ||
      if @file.respond_to?(:content_type) && @file.content_type
        Marcel::MimeType.for(declared_type: @file.content_type.to_s.chomp)
      end
  end
end
# For CarrierWave 2.x
CarrierWave::SanitizedFile.class_eval do
  def existing_content_type
    if @file.respond_to?(:content_type) && @file.content_type
      Marcel::MimeType.for(declared_type: @file.content_type.to_s.chomp)
    end
  end
end

References

OWASP - File Upload Cheat Sheet

🚨 CarrierWave Content-Type allowlist bypass vulnerability, possibly leading to XSS

###Impact
CarrierWave::Uploader::ContentTypeAllowlist
has a Content-Type allowlist bypass vulnerability, possibly leading to XSS.

The validation in allowlisted_content_type? determines Content-Type
permissions by performing a partial match.
If the content_type argument of allowlisted_content_type? is passed
a value crafted by the attacker, Content-Types not included in the
content_type_allowlist will be allowed.

In addition, by setting the Content-Type configured by the attacker
at the time of file delivery, it is possible to cause XSS on the
user's browser when the uploaded file is opened.

Patches

Upgrade to 3.0.5
or 2.2.5.

Workarounds

When validating with allowlisted_content_type? in
CarrierWave::Uploader::ContentTypeAllowlist,
forward match(\\A) the Content-Type set in content_type_allowlist,
preventing unintentional permission of text/html;image/png when
you want to allow only image/png in content_type_allowlist.

References

OWASP - File Upload Cheat Sheet

Release Notes

2.2.6

More info than we can show here.

2.2.4

More info than we can show here.

2.2.3

More info than we can show here.

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.

✳️ mini_magick (4.11.0 → 4.12.0) · Repo · Changelog

Release Notes

4.12.0

More info than we can show here.

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.

↗️ addressable (indirect, 2.8.0 → 2.8.6) · Repo · Changelog

Release Notes

2.8.6 (from changelog)

More info than we can show here.

2.8.5 (from changelog)

More info than we can show here.

2.8.4 (from changelog)

More info than we can show here.

2.8.3 (from changelog)

More info than we can show here.

2.8.2 (from changelog)

More info than we can show here.

2.8.1 (from changelog)

More info than we can show here.

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

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

Release Notes

1.2.3

More info than we can show here.

1.2.2

More info than we can show here.

1.2.1

More info than we can show here.

1.2.0

More info than we can show here.

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.

↗️ ffi (indirect, 1.15.5 → 1.16.3) · Repo · Changelog

Release Notes

1.16.3 (from changelog)

More info than we can show here.

1.16.2 (from changelog)

More info than we can show here.

1.16.1 (from changelog)

More info than we can show here.

1.16.0 (from changelog)

More info than we can show here.

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.12.0 → 1.14.4) · Repo · Changelog

Release Notes

1.14.4

More info than we can show here.

1.14.3

More info than we can show here.

1.14.1

More info than we can show here.

1.14.0

More info than we can show here.

1.13.0

More info than we can show here.

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.

↗️ marcel (indirect, 1.0.2 → 1.0.4) · Repo

Release Notes

1.0.4

More info than we can show here.

1.0.3

More info than we can show here.

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.

↗️ mini_mime (indirect, 1.1.2 → 1.1.5) · Repo · Changelog

Commits

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

↗️ minitest (indirect, 5.16.2 → 5.22.3) · Repo · Changelog

Release Notes

5.22.2 (from changelog)

More info than we can show here.

5.22.1 (from changelog)

More info than we can show here.

5.22.0 (from changelog)

More info than we can show here.

5.21.2 (from changelog)

More info than we can show here.

5.21.1 (from changelog)

More info than we can show here.

5.21.0 (from changelog)

More info than we can show here.

5.20.0 (from changelog)

More info than we can show here.

5.19.0 (from changelog)

More info than we can show here.

5.18.1 (from changelog)

More info than we can show here.

5.18.0 (from changelog)

More info than we can show here.

5.17.0 (from changelog)

More info than we can show here.

5.16.3 (from changelog)

More info than we can show here.

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.

↗️ public_suffix (indirect, 4.0.7 → 5.0.4) · Repo · Changelog

Release Notes

5.0.4 (from changelog)

More info than we can show here.

5.0.3 (from changelog)

More info than we can show here.

5.0.1 (from changelog)

More info than we can show here.

5.0.0 (from changelog)

More info than we can show here.

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.

↗️ ruby-vips (indirect, 2.1.4 → 2.2.1) · Repo · Changelog

Release Notes

2.2.1 (from changelog)

More info than we can show here.

2.2.0 (from changelog)

More info than we can show here.

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.

↗️ ssrf_filter (indirect, 1.0.7 → 1.1.2) · Repo · Changelog

Release Notes

1.1.2

More info than we can show here.

1.1.1

More info than we can show here.

1.1.0

More info than we can show here.

1.0.8 (from changelog)

More info than we can show here.

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.

↗️ tzinfo (indirect, 2.0.5 → 2.0.6) · Repo · Changelog

Release Notes

2.0.6

More info than we can show here.

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 cancel merge
Cancels automatic merging of this PR
@​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 Mar 27, 2024
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.702%. Comparing base (d2b8bcf) to head (a84a05d).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #295   +/-   ##
=========================================
  Coverage   95.702%   95.702%           
=========================================
  Files          311       311           
  Lines         2955      2955           
=========================================
  Hits          2828      2828           
  Misses         127       127           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

0 participants