Closed RicottaZhang closed 2 years ago
https://github.com/huacnlee/carrierwave-aliyun/blob/dc8de78885a53ebb9505b1c2b028b6e15b6a55d2/lib/carrierwave/storage/aliyun.rb#L9
通过该行代码,覆盖了OSS原生的自动识别content-type功能。 攻击者通过修改上传数据的content-type上传了后缀为.png的白名单后缀文件,简单利用curl即可。
.png
--data-raw $'------WebKitFormBoundaryKYyQo1yApqB1pdPN\r\nContent-Disposition: form-data; name="image_file"; filename="attack.png"\r\nContent-Type: text/html\r\n\r\n\r\n------WebKitFormBoundaryKYyQo1yApqB1pdPN--\r\n' \
https://github.com/carrierwaveuploader/carrierwave#securing-uploads
https://github.com/huacnlee/carrierwave-aliyun/blob/dc8de78885a53ebb9505b1c2b028b6e15b6a55d2/lib/carrierwave/storage/aliyun.rb#L9
通过该行代码,覆盖了OSS原生的自动识别content-type功能。 攻击者通过修改上传数据的content-type上传了后缀为
.png
的白名单后缀文件,简单利用curl即可。