---
title: Paperclip Security Release
teaser: We released Paperclip v4.2.2 with a security fix.
tags: news,web,open source,security,ruby,paperclip
author: Tute Costa
published_on: 2015-06-05
---

We just released paperclip v4.2.2. This contains only a security patch over
v4.2.1, and everyone is encouraged to upgrade. The [commit message] explains the
problem and fix:

[commit message]: https://github.com/thoughtbot/paperclip/commit/9aee4112f36058cd28d5fe4a006d6981bd1eda57

> There is an issue where if an HTML file is uploaded with a .html extension, but the content type is listed as being `image/jpeg`, this will bypass a validation checking for images. But it will also pass the spoof check, because a file named .html and containing actual HTML passes the spoof check.
>
> This change makes it so that we also check the supplied content type. So even if the file contains HTML and ends with .html, it doesn't match the content type of `image/jpeg` and so it fails.

This vulnerability was assigned [JVN #83881261].

[JVN #83881261]: https://jvn.jp/en/jp/JVN83881261/

[paperclip] is a Rubygem that that lets you attach files to ActiveRecord
models.

[paperclip]: https://rubygems.org/gems/paperclip

Thanks to Jon Yurek and Mike Burns for their work on this, and special thanks to
MORI Shingo of DeNA Co., Ltd. for reporting the vulnerability.
