PT-2024-22687
CVE-2024-29034
·
تاريخ النشر
2024-03-24
·
تاريخ التحديث
2025-11-07
الوصف من
CVSS 3.1
6.8
متوسطةالمقاييسAV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N
Name of the Vulnerable Software and Affected Versions
CarrierWave versions prior to 2.2.6
CarrierWave versions prior to 3.0.7
Description
The issue 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.Recommendations
For CarrierWave versions prior to 2.2.6, upgrade to 2.2.6.
For CarrierWave versions prior to 3.0.7, upgrade to 3.0.7.
As a temporary workaround, consider using the provided monkey patch to let CarrierWave parse the Content-type by using
Marcel::MimeType.for.
For CarrierWave 3.x, use the following monkey patch:ruby
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
endFor CarrierWave 2.x, use the following monkey patch:
ruby
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قابلية الاستغلال
استغلال
إصلاح
التأثيرات
المورّدون
المنتجات المتأثرة
وجدت خطأً في الوصف؟ لديك ما تضيفه؟ لا تتردد في مراسلتنا 👾