🚨 [security] Update rack: 2.0.3 → 2.0.6 (patch)
**Welcome to Depfu** 👋
This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.
After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.
[Let us know](mailto:hi@depfu.com) if you have any questions. Thanks so much for giving Depfu a try!
Advisory: CVE-2018-16471 Disclosed: November 05, 2018 URL: https://groups.google.com/forum/#!topic/ruby-security-ann/NAalCee8n6o
Possible XSS vulnerability in Rack
There is a possible vulnerability in Rack. This vulnerability has been
assigned the CVE identifier CVE-2018-16471.Versions Affected: All.
Not affected: None.
Fixed Versions: 2.0.6, 1.6.11Impact
There is a possible XSS vulnerability in Rack. Carefully crafted requests can
impact the data returned by thescheme
method onRack::Request
.
Applications that expect the scheme to be limited to "http" or "https" and do
not escape the return value could be vulnerable to an XSS attack.Vulnerable code looks something like this:
<%= request.scheme.html_safe %>
Note that applications using the normal escaping mechanisms provided by Rails
may not impacted, but applications that bypass the escaping mechanisms, or do
not use them may be vulnerable.All users running an affected release should either upgrade or use one of the
workarounds immediately.Releases
The 2.0.6 and 1.6.11 releases are available at the normal locations.
Workarounds
The following monkey patch can be applied to work around this issue:
require "rack" require "rack/request" class Rack::Request SCHEME_WHITELIST = %w(https http).freeze def scheme if get_header(Rack::HTTPS) == 'on' 'https' elsif get_header(HTTP_X_FORWARDED_SSL) == 'on' 'https' elsif forwarded_scheme forwarded_scheme else get_header(Rack::RACK_URL_SCHEME) end end def forwarded_scheme scheme_headers = [ get_header(HTTP_X_FORWARDED_SCHEME), get_header(HTTP_X_FORWARDED_PROTO).to_s.split(',')[0] ] scheme_headers.each do |header| return header if SCHEME_WHITELIST.include?(header) end nil end end
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
What changed?
↗ ️ rack (indirect, 2.0.3 → 2.0.6) · Repo · Changelog
Commits
See the full diff on Github. The new version differs by 19 commits:
Bumping version for release
Whitelist http/https schemes
Reduce buffer size to avoid pathological parsing
Merge tag '2.0.5' into 2-0-stable
Merge pull request #1296 from tomelm/fix-prefers-plaintext
Bump version for release
Merge pull request #1268 from eileencodes/forwardport-pr-1249-to-2-0-stable
Merge pull request #1249 from mclark/handle-invalid-method-parameters
Stick with a passing version of Rubygems and bundler
Leahize
Bumping version
webrick: remove concurrent-ruby dev dependency
Merge pull request #1190 from hugoabonizio/master
Merge pull request #1193 from tompng/multipart_less_memory
Merge pull request #1192 from jkowens/master
Merge pull request #1179 from tompng/master
Merge pull request #1151 from cremno/simplify-some-string-creations
Merge pull request #1189 from lugray/fix_rack_lock
Require the right file for the digest we're using
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase
.
All Depfu comment commands
- @depfu rebase
- Rebases against your default branch and redoes this update
- @depfu merge
- Merges this PR once your tests are passing and conflicts are resolved
- @depfu reopen
- Restores the branch and reopens this PR (if it's closed)
- @depfu pause
- Ignores all future updates for this dependency and closes this PR
- @depfu pause [minor|major]
- Ignores all future minor/major updates for this dependency and closes this PR
- @depfu resume
- Future versions of this dependency will create PRs again (leaves this PR as is)