🚨 Your current dependencies have known security vulnerabilities 🚨
This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!
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.
better_errors prior to 2.8.0 did not implement CSRF protection for its internal requests. It also did not enforce the correct "Content-Type" header for these requests, which allowed a cross-origin "simple request" to be made without CORS protection. These together left an application with better_errors enabled open to cross-origin attacks.
As a developer tool, better_errors documentation strongly recommends addition only to the development bundle group, so this vulnerability should only affect development environments. Please ensure that your project limits better_errors to the development group (or the non-Rails equivalent).
Patches
Starting with release 2.8.x, CSRF protection is enforced. It is recommended that you upgrade to the latest release, or minimally to "~> 2.8.3".
Workarounds
There are no known workarounds to mitigate the risk of using older releases of better_errors.
* Improve template parsing, mostly by reducing allocations (jeremyevans)
* Do not ship tests in the gem, reducing gem size about 20% (jeremyevans)
* Support :literal_prefix and :literal_postfix options for how to output literal tags (e.g. <%% code %>) (jaredcwhite) (#26, #27)
1.9.0 (from changelog)
* Change default :bufvar from 'String.new' to '::String.new' to work with BasicObject (jeremyevans)
1.8.0 (from changelog)
* Support :yield_returns_buffer option in capture_end for always returning the (potentially modified) buffer in <%|= tags (evanleck) (#15)
It is possible to forge a secure or host-only cookie prefix in Rack using
an arbitrary cookie write by using URL encoding (percent-encoding) on the
name of the cookie. This could result in an application that is dependent on
this prefix to determine if a cookie is safe to process being manipulated
into processing an insecure or cross-origin request.
This vulnerability has been assigned the CVE identifier CVE-2020-8184.
Versions Affected: rack < 2.2.3, rack < 2.1.4
Not affected: Applications which do not rely on __Host- and __Secure- prefixes to determine if a cookie is safe to process
Fixed Versions: rack >= 2.2.3, rack >= 2.1.4
Impact
An attacker may be able to trick a vulnerable application into processing an
insecure (non-SSL) or cross-origin request if they can gain the ability to write
arbitrary cookies that are sent to the application.
Workarounds
If your application is impacted but you cannot upgrade to the released versions or apply
the provided patch, this issue can be temporarily addressed by adding the following workaround:
module Rack
module Utils
module_function def parse_cookies_header(header)
return {} unless header
header.split(/[;] */n).each_with_object({}) do |cookie, cookies|
next if cookie.empty?
key, value = cookie.split('=', 2)
cookies[key] = (unescape(value) rescue value) unless cookies.key?(key)
end
end
end
end
It is possible to forge a secure or host-only cookie prefix in Rack using
an arbitrary cookie write by using URL encoding (percent-encoding) on the
name of the cookie. This could result in an application that is dependent on
this prefix to determine if a cookie is safe to process being manipulated
into processing an insecure or cross-origin request.
This vulnerability has been assigned the CVE identifier CVE-2020-8184.
Versions Affected: rack < 2.2.3, rack < 2.1.4
Not affected: Applications which do not rely on __Host- and __Secure- prefixes to determine if a cookie is safe to process
Fixed Versions: rack >= 2.2.3, rack >= 2.1.4
Impact
An attacker may be able to trick a vulnerable application into processing an
insecure (non-SSL) or cross-origin request if they can gain the ability to write
arbitrary cookies that are sent to the application.
Workarounds
If your application is impacted but you cannot upgrade to the released versions or apply
the provided patch, this issue can be temporarily addressed by adding the following workaround:
module Rack
module Utils
module_function def parse_cookies_header(header)
return {} unless header
header.split(/[;] */n).each_with_object({}) do |cookie, cookies|
next if cookie.empty?
key, value = cookie.split('=', 2)
cookies[key] = (unescape(value) rescue value) unless cookies.key?(key)
end
end
end
end
There was a possible directory traversal vulnerability in the Rack::Directory app
that is bundled with Rack.
Versions Affected: rack < 2.2.0
Not affected: Applications that do not use Rack::Directory.
Fixed Versions: 2.1.3, >= 2.2.0
Impact
If certain directories exist in a director that is managed by Rack::Directory, an attacker could, using this vulnerability, read the
contents of files on the server that were outside of the root specified in the
Rack::Directory initializer.
Workarounds
Until such time as the patch is applied or their Rack version is upgraded,
we recommend that developers do not use Rack::Directory in their
applications.
There was a possible directory traversal vulnerability in the Rack::Directory app
that is bundled with Rack.
Versions Affected: rack < 2.2.0
Not affected: Applications that do not use Rack::Directory.
Fixed Versions: 2.1.3, >= 2.2.0
Impact
If certain directories exist in a director that is managed by Rack::Directory, an attacker could, using this vulnerability, read the
contents of files on the server that were outside of the root specified in the
Rack::Directory initializer.
Workarounds
Until such time as the patch is applied or their Rack version is upgraded,
we recommend that developers do not use Rack::Directory in their
applications.
There's a possible information leak / session hijack vulnerability in Rack.
Attackers may be able to find and hijack sessions by using timing attacks
targeting the session id. Session ids are usually stored and indexed in a
database that uses some kind of scheme for speeding up lookups of that
session id. By carefully measuring the amount of time it takes to look up
a session, an attacker may be able to find a valid session id and hijack
the session.
The session id itself may be generated randomly, but the way the session is
indexed by the backing store does not use a secure comparison.
Impact:
The session id stored in a cookie is the same id that is used when querying
the backing session storage engine. Most storage mechanisms (for example a
database) use some sort of indexing in order to speed up the lookup of that
id. By carefully timing requests and session lookup failures, an attacker
may be able to perform a timing attack to determine an existing session id
and hijack that session.
There is a possible DoS vulnerability in the multipart parser in Rack.
Carefully crafted requests can cause the multipart parser to enter a
pathological state, causing the parser to use CPU resources disproportionate to
the request size.
Impacted code can look something like this:
Rack::Request.new(env).params
But any code that uses the multi-part parser may be vulnerable.
Rack users that have manually adjusted the buffer size in the multipart parser
may be vulnerable as well.
All users running an affected release should either upgrade or use one of the
workarounds immediately.
Releases
The 2.0.6 release is available at the normal locations.
Workarounds
To work around this issue, the following code can be used:
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.11
Impact
There is a possible XSS vulnerability in Rack. Carefully crafted requests can
impact the data returned by the scheme method on Rack::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
Response.[] and MockResponse.[] for creating instances using status, headers, and body. (@ioquatix)
Convenient cache and content type methods for Rack::Response. (#1555, @ioquatix)
Changed
Request#params no longer rescues EOFError. (@jeremyevans)
Directory uses a streaming approach, significantly improving time to first byte for large directories. (@jeremyevans)
Directory no longer includes a Parent directory link in the root directory index. (@jeremyevans)
QueryParser#parse_nested_query uses original backtrace when reraising exception with new class. (@jeremyevans)
ConditionalGet follows RFC 7232 precedence if both If-None-Match and If-Modified-Since headers are provided. (@jeremyevans)
.ru files supports the frozen-string-literal magic comment. (@eregon)
Rely on autoload to load constants instead of requiring internal files, make sure to require 'rack' and not just 'rack/...'. (@jeremyevans)
Etag will continue sending ETag even if the response should not be cached. (@henm)
Request#host_with_port no longer includes a colon for a missing or empty port. (@AlexWayfer)
All handlers uses keywords arguments instead of an options hash argument. (@ioquatix)
Files handling of range requests no longer return a body that supports to_path, to ensure range requests are handled correctly. (@jeremyevans)
Multipart::Generator only includes Content-Length for files with paths, and Content-Dispositionfilename if the UploadedFile instance has one. (@jeremyevans)
Request#ssl? is true for the wss scheme (secure websockets). (@jeremyevans)
Rack::HeaderHash is memoized by default. (#1549, @ioquatix)
Rework host/hostname/authority implementation in Rack::Request. #host and #host_with_port have been changed to correctly return IPv6 addresses formatted with square brackets, as defined by RFC3986. (#1561, @ioquatix)
Rack::Builder parsing options on first #\ line is deprecated. (#1574, @ioquatix)
Removed
Directory#path as it was not used and always returned nil. (@jeremyevans)
BodyProxy#each as it was only needed to work around a bug in Ruby <1.9.3. (@jeremyevans)
URLMap::INFINITY and URLMap::NEGATIVE_INFINITY, in favor of Float::INFINITY. (@ch1c0t)
Deprecation of Rack::File. It will be deprecated again in rack 2.2 or 3.0. (@rafaelfranca)
Support for Ruby 2.2 as it is well past EOL. (@ioquatix)
Remove Rack::Files#response_body as the implementation was broken. (#1153, @ioquatix)
Remove SERVER_ADDR which was never part of the original SPEC. (#1573, @ioquatix)
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 recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu close
Closes this PR and deletes the branch
@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)
🚨 Your current dependencies have known security vulnerabilities 🚨
This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!
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?
✳️ better_errors (2.5.0 → 2.9.1) · Repo · Changelog
Security Advisories 🚨
🚨 Older releases of better_errors open to Cross-Site Request Forgery attack
Release Notes
2.9.1
2.9.0
2.8.3
2.8.2
2.8.1
2.8.0
2.7.1
2.7.0
2.6.0
2.5.1
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
↗️ coderay (indirect, 1.1.2 → 1.1.3) · Repo · Changelog
Release Notes
1.1.3
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 56 commits:
bump version
like this?
trying to fix tests for 1.9.3
add changelog
Merge pull request #246 from deivid-rodriguez/fix_rubygems_deprecation
Fix rubygems deprecation
don't load simplecov on Ruby 1.8.7
Merge branch 'extend-specs'
merge coverage
Merge pull request #243 from rubychan/extend-specs
add simple spec for CodeRay.scan
disable specs for Ruby 1.8.7
maybe like this?
reorder gems
also test with 2.7.0-preview3
also disable for Ruby 1.8.7
actually, we only need to disable SimpleCov
fix tests for Ruby 2.3
add spec for CodeRay.coderay_path
fix tests for Ruby Enterprise Edition?
add SimpleCov
still not loaded?
fix load path
run specs on rake test
add RSpec
enforce UselessAccessModifier
fix spaces around operators (RuboCop)
fix spaces in JSONEncoderTest
tunr off maintainability checks
enforce RuboCop version
tweaks to RuboCop config
enfore SpaceAroundOperators
try setting up code climate test coverage
Update README.markdown
not available on CodeClimate
start using RuboCop
reorder gems
fix heredoc indentation
remove .codeclimate.yml
add CodeClimate config
apparently, 1.8.7 fails on Travis?
update changelog
Merge branch 'master' of github.com:rubychan/coderay
Merge pull request #229 from dfa1/java10-support
remove defunct Gemnasium badge
add numeric to SQL types
Merge pull request #227 from junaruga/hotfix/not-reached-statement
Merge pull request #233 from junaruga/hotfix/ruby26-expression-enumerator
Add Ruby 2.6 fixing issues
support for special type 'var'
Remove the statement that is not always reached.
tweak list of rubies to test
test with ruby 2.5, too
trying to fix tests for Ruby 2.4
backport .gitignore from dsl branch
port a few tweaks from dsl branch
↗️ erubi (indirect, 1.7.1 → 1.10.0) · Repo · Changelog
Release Notes
1.10.0 (from changelog)
1.9.0 (from changelog)
1.8.0 (from changelog)
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 40 commits:
Bump version to 1.10.0
Enable branch coverage when testing
Move <% case above <%# and <%% cases as it is more common
Cover some rspace/lspace branches in CaptureEndEngine
Test <%= tailch rspace branch and src ending with newline branch
Remove unnecessary line
Remove unnecessary branch
Adjust nocov markings
Don't call add_text with nil
Fix regression where only first backslash/apostrophe was escaped
Improve template parsing, mostly by reducing allocations
Do not ship tests in the gem, reducing gem size about 20%
Start testing Ruby 2.7 on Travis
Update copyright year
Add nocov markers
Make spec_w task use warning gem instead of egrep for filtering
Improve rdoc formatting
Update CHANGELOG
Allow the literal prefix/postfix to be configured (Fixes #26, #27)
Refactor and simplify internals
Reduce memory usage when escaping text
Fix documentation of options bufval, bufvar in Erubi::Engine's initializer
Bump version to 1.9.0
Change default :bufvar from 'String.new' to '::String.new' to work with BasicObject
Try to get Travis passing
Use minitest-global_expecations in tests to avoid deprecation issues with minitest 5.12
Test JRuby 9.2 on Travis
Test on TruffleRuby on Travis
CI: Add Ruby 2.6 to the matrix
Bump version to 1.8.0
Fix and expand on documentation for :yield_returns_buffer
Rename return_buffer option to yield_returns_buffer
Modify test to work with new :return_buffer behavior
Flip `result` and `code` for :return_buffer option
Disable minitest plugins when testing
Modify spec to show how :return_buffer can be used when modifying buffers
Simplify test in attempt to get 1.8.7 passing
Add return_buffer option to CaptureEndEngine
Update the README with an example of how to write a method that works with capture_end (Fixes #15)
Remove has_rdoc from gemspec, since it is deprecated
↗️ rack (indirect, 2.0.5 → 2.2.3) · Repo · Changelog
Security Advisories 🚨
🚨 Percent-encoded cookies can be used to overwrite existing prefixed cookie names
🚨 Percent-encoded cookies can be used to overwrite existing prefixed cookie names
🚨 Directory traversal in Rack::Directory app bundled with Rack
🚨 Directory traversal in Rack::Directory app bundled with Rack
🚨 Possible information leak / session hijack vulnerability
🚨 Possible DoS vulnerability in Rack
🚨 Possible XSS vulnerability in Rack
Release Notes
2.2.2 (from changelog)
2.2.1 (from changelog)
2.2.0 (from changelog)
2.1.2 (from changelog)
2.1.1 (from changelog)
2.1.0 (from changelog)
2.0.8 (from changelog)
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
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