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

Update dependency carrierwave to v2.2.6 [SECURITY] #2338

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 25, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
carrierwave 2.2.5 -> 2.2.6 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-29034

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


Release Notes

carrierwaveuploader/carrierwave (carrierwave)

v2.2.6: 2.2.6

Compare Source

Security

Configuration

📅 Schedule: Branch creation - "" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the security An issue with the security of the service label Mar 25, 2024
@renovate renovate bot enabled auto-merge (squash) March 25, 2024 20:10
@renovate renovate bot merged commit bd1eb7e into main Mar 25, 2024
2 checks passed
@renovate renovate bot deleted the renovate/rubygems-carrierwave-vulnerability branch March 25, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security An issue with the security of the service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants