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] [ruby] Update all of rails: 5.2.4.1 → 5.2.4.2 (patch) #381

Merged
merged 1 commit into from Mar 19, 2020

Conversation

@depfu
Copy link
Contributor

depfu bot commented Mar 19, 2020


🚨 Your version of actionview has known security vulnerabilities 🚨

Advisory: CVE-2020-5267
Disclosed: March 19, 2020
URL: https://groups.google.com/forum/#!topic/rubyonrails-security/55reWMM_Pg8

Possible XSS vulnerability in ActionView

There is a possible XSS vulnerability in ActionView's JavaScript literal
escape helpers. Views that use the j or escape_javascript methods
may be susceptible to XSS attacks.

Versions Affected: All.
Not affected: None.
Fixed Versions: 6.0.2.2, 5.2.4.2

Impact

There is a possible XSS vulnerability in the j and escape_javascript
methods in ActionView. These methods are used for escaping JavaScript string
literals. Impacted code will look something like this:

<script>let a = `<%= j unknown_input %>`</script>

or

<script>let a = `<%= escape_javascript unknown_input %>`</script>

Releases

The 6.0.2.2 and 5.2.4.2 releases are available at the normal locations.

Workarounds

For those that can't upgrade, the following monkey patch may be used:

ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP.merge!(
  {
    "`" => "\\`",
    "$" => "\\$"
  }
)

module ActionView::Helpers::JavaScriptHelper
alias :old_ej :escape_javascript
alias :old_j :j

def escape_javascript(javascript)
javascript = javascript.to_s
if javascript.empty?
result = ""
else
result = javascript.gsub(/(\|</|\r\n|\342\200\250|\342\200\251|[\n\r"']|[`]|[$])/u, JS_ESCAPE_MAP)
end
javascript.html_safe? ? result.html_safe : result
end

alias :j :escape_javascript
end


🚨 We recommend to merge and deploy this update 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?

✳️ rails (5.2.4.1 → 5.2.4.2) · Repo

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ actioncable (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ actionmailer (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ actionpack (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ actionview (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ activejob (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ activemodel (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ activerecord (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ activestorage (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

↗️ activesupport (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ method_source (indirect, 0.9.2 → 1.0.0) · Repo

Commits

See the full diff on Github. The new version differs by 17 commits:

↗️ nokogiri (indirect, 1.10.8 → 1.10.9) · Repo · Changelog

Release Notes

1.10.9

1.10.9 / 2020-03-01

Fixed

  • [MRI] Raise an exception when Nokogiri detects a specific libxml2 edge case involving blank Schema nodes wrapped by Ruby objects that would cause a segfault. Currently no fix is available upstream, so we're preventing a dangerous operation and informing users to code around it if possible. [#1985, #2001]
  • [JRuby] Change NodeSet#to_a to return a RubyArray instead of Object, for compilation under JRuby 9.2.9 and later. [#1968, #1969] (Thanks, @headius!)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 5 commits:

↗️ railties (indirect, 5.2.4.1 → 5.2.4.2) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 2 commits:


Depfu Status

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)
@depfu depfu bot added the depfu label Mar 19, 2020
@codecov

This comment has been minimized.

Copy link

codecov bot commented Mar 19, 2020

Codecov Report

Merging #381 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #381   +/-   ##
=======================================
  Coverage   89.15%   89.15%           
=======================================
  Files          35       35           
  Lines         636      636           
=======================================
  Hits          567      567           
  Misses         69       69           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2262e9...60d25fe. Read the comment docs.

@ruebot ruebot merged commit cb40dfc into master Mar 19, 2020
2 checks passed
2 checks passed
codecov/patch Coverage not affected when comparing e2262e9...60d25fe
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@depfu depfu bot deleted the depfu/update/group/rails-5.2.4.2 branch Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.