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

[Security] Bump paperclip from 5.1.0 to 6.1.0 #426

Merged
merged 1 commit into from
Feb 19, 2019
Merged

[Security] Bump paperclip from 5.1.0 to 6.1.0 #426

merged 1 commit into from
Feb 19, 2019

Conversation

greysteil
Copy link

Bumps paperclip from 5.1.0 to 6.1.0. This update includes security fixes.

Vulnerabilities fixed

Sourced from The GitHub Vulnerability Alert Database.

CVE-2017-0889
See https://nvd.nist.gov/vuln/detail/CVE-2017-0889.

Affected versions: >= 3.1.4, < 5.2.0

Sourced from The Ruby Advisory Database.

Paperclip ruby gem suffers from a Server-Side Request Forgery (SSRF) vulnerability in the Paperclip::UriAdapter and Paperclip::HttpUrlProxyAdapter class.
Paperclip gem provides multiple ways a file can be uploaded to a web server.
The vulnerability affects two of Paperclip’s IO adapters that accept URLs as
attachment data (UriAdapter and HttpUrlProxyAdapter). When these adapters are
used, Paperclip acts as a proxy and downloads the file from the website URI
that is passed in. The library does not perform any validation to protect
against Server Side Request Forgery (SSRF) exploits by default. This may allow
a remote attacker to access information about internal network resources.

Patched versions: >= 5.2.0
Unaffected versions: none

Release notes

Sourced from paperclip's releases.

Version 6.1.0

  • BUGFIX: Don't double-encode URLs (Roderick Monje).
  • BUGFIX: Only use the content_type when it exists (Jean-Philippe Doyle).
  • STABILITY: Better handling of the content-disposition header. Now supports file name that is either enclosed or not in double quotes and is case insensitive as per RC6266 grammar (Hasan Kumar, Yves Riel).
  • STABILITY: Change database column type of attachment file size from unsigned 4-byte integer to unsigned 8-byte bigint. The former type limits attachment size to just over 2GB, which can easily be exceeded by a large video file (Laurent Arnoud, Alen Zamanyan).
  • STABILITY: Better error message when thumbnail processing errors (Hayden Ball).
  • STABILITY: Fix file linking issues around Windows (Akihiko Odaki).
  • STABILITY: Files without an extension will now be checked for spoofing attempts (George Walters II).
  • STABILITY: Manually close Tempfiles when we are done with them (Erkki Eilonen).

v6.0.0

6.0.0 (2018-03-09):

5.3.0 (2018-03-09):

5.2.1 (2018-01-25):

  • Bugfix: Fix copying files on Windows. (#2532)

5.2.0 (2018-01-23):

  • Security: Remove the automatic loading of URI adapters. Some of these
    adapters can be specially crafted to expose your network topology. (#2435)

  • Bugfix: The rake task no longer rescues Exception. (#2476)

  • Bugfix: Handle malformed Content-Disposition headers (#2283)

  • Bugfix: The :only_process option works when passed a lambda again. (#2289)

  • Improvement: Added :use_accelerate_endpoint option when using S3 to enable
    Amazon S3 Transfer Acceleration
    (#2291)

  • Improvement: Make the fingerprint digest configurable per attachment. The
    default remains MD5. Making this configurable means it can change in a future
    version because it is not considered secure anymore against intentional file
    corruption. For more info, see https://en.wikipedia.org/wiki/MD5#Security

    You can change the digest used for an attachment by adding the
    :adapter_options parameter to the has_attached_file options like this:

... (truncated)
Changelog

Sourced from paperclip's changelog.

6.1.0 (2018-07-27):

  • BUGFIX: Don't double-encode URLs (Roderick Monje).
  • BUGFIX: Only use the content_type when it exists (Jean-Philippe Doyle).
  • STABILITY: Better handling of the content-disposition header. Now supports
    file name that is either enclosed or not in double quotes and is case
    insensitive as per RC6266 grammar (Hasan Kumar, Yves Riel).
  • STABILITY: Change database column type of attachment file size from unsigned 4-byte
    integer to unsigned 8-byte bigint. The former type limits attachment size
    to just over 2GB, which can easily be exceeded by a large video file (Laurent
    Arnoud, Alen Zamanyan).
  • STABILITY: Better error message when thumbnail processing errors (Hayden Ball).
  • STABILITY: Fix file linking issues around Windows (Akihiko Odaki).
  • STABILITY: Files without an extension will now be checked for spoofing attempts
    (George Walters II).
  • STABILITY: Manually close Tempfiles when we are done with them (Erkki Eilonen).

6.0.0 (2018-03-09):

5.3.0 (2018-03-09):

5.2.1 (2018-01-25):

  • Bugfix: Fix copying files on Windows. (#2532)

5.2.0 (2018-01-23):

  • Security: Remove the automatic loading of URI adapters. Some of these
    adapters can be specially crafted to expose your network topology. (#2435)
  • Bugfix: The rake task no longer rescues Exception. (#2476)
  • Bugfix: Handle malformed Content-Disposition headers (#2283)
  • Bugfix: The :only_process option works when passed a lambda again. (#2289)
  • Improvement: Added :use_accelerate_endpoint option when using S3 to enable
    Amazon S3 Transfer Acceleration
    (#2291)
  • Improvement: Make the fingerprint digest configurable per attachment. The
... (truncated)
Commits
  • acbb03f Bump 6.1.0 [ci skip]
  • ee144c6 Fix cucumber tests after integer -> bigint conversion
  • 34ec355 Increase attachment file size from int (4 bytes) to bigint (8 bytes).
  • 90f9121 Close + unlink Tempfiles
  • f384174 Rely on URI content_type only when provided.
  • 7eb664f Check for spoofing of files without an extension
  • 0d93e0f add is_windows to option
  • 76a33f0 Update processor.rb
  • 5d9b2ba Update processor.rb
  • 037b975 Update processor.rb
  • Additional commits viewable in compare view

(This is an example of the kind of PRs Dependabot creates, so you can see it in action alongside #425. It won't automatically rebase or any of the clever stuff Dependabot normally does because I've manually copied it across, though.)

Bumps [paperclip](https://github.com/thoughtbot/paperclip) from 5.1.0 to 6.1.0. **This update includes security fixes.**
- [Release notes](https://github.com/thoughtbot/paperclip/releases)
- [Changelog](https://github.com/thoughtbot/paperclip/blob/master/NEWS)
- [Commits](thoughtbot/paperclip@v5.1.0...v6.1.0)

Signed-off-by: dependabot[bot] <[email protected]>
@greysteil
Copy link
Author

Note: the major version bump is because of the aws version change. It should be breaking.

@@ -36,7 +36,7 @@ gem "twitter-text" # hashtag parsing
gem "jquery-atwho-rails", "~> 1.3.2" # autocomplete
gem "haml-rails"
gem "audited-activerecord", "~> 4.0"
gem "paperclip", "~> 5.1.0"
gem "paperclip", "~> 6.1.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Copy link
Author

@greysteil greysteil Sep 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @houndci-bot, but that would be inconsistent with the rest of this file...

@jurre jurre merged commit 1cebfd2 into DefactoSoftware:development Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants