The thoughtbot paperclip gem before 4.2.2 for Ruby does not consider the content-type value during media-type validation, which allows remote attackers to upload HTML documents and conduct cross-site scripting (XSS) attacks via a spoofed value, as demonstrated by image/jpeg.
https://robots.thoughtbot.com/paperclip-security-release
http://www.securityfocus.com/bid/75304
http://openwall.com/lists/oss-security/2015/06/19/3