-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Status for MRI-related security issues? #5126
Comments
PS: I do realise that like anything else, asserting & following all this takes time, and that resources are limited - I don't feel entitled to anything, just wondering what is the current status! Thanks. |
We have been monitoring the various CVEs but have not been able to review them all. In general, most CVEs for CRuby don't apply to JRuby because they involve unsafe memory accesses that are not possible on the JVM. In native code, usually only DoS-type issues will also apply to JRuby, since much of our code uses the same algorithms as CRuby. Any CVE that affects the Ruby-based standard library merits investigation. We ship a largely-unmodified copy of CRuby's standard library. That has not been updated in the 9.1 line since around Ruby 2.3.2 timeframe, so any CVEs affecting it after that time should get incorporated. I believe we have held off updating the standard library mostly because we expected JRuby 9.2 to be finished sooner, with support for current 2.4 or 2.5 and current stdlib to go with them. |
I'm going to bump this to 9.2 so we have time to review these CVEs. We could use some help figuring out which ones might affect JRuby...they hide the related commits rather well. |
Reviewing the releases mentioned, plus all releases after 2.5.1. Some of these have specs in ruby/spec/security, which we pass (except one failure for Array#pack tainting which we do not support and which is deprecated in Ruby). Note that these likely have the same status on 9.2 (which also tracks latest stdlib and gems) but a separate review should be done. I review 9.3 for pre-release here. Individually reviewing the various security disclosures below:
JRuby tracks latest WEBrick gem in 9.3 and uses it without modification. We will do a final update before release. CVE-2017-17742 is also tested by a security spec.
JRuby reuses relevant portions of CRuby's tempfile library (recently updated and will be updated again before release) with a native implementation of Tempfile itself based on IO. CVE-2018-6914 is also tested in specs. CVE-2021-28966 involves the tmpdir library, which JRuby tracks from CRuby's 2.6 HEAD.
Largely applies only to the C implementation, but is also tested in specs.
NUL bytes do not leak out to native calls in most cases in JRuby. In addition, the Dir and File functionality is provided by JDK APIs that are also safe. CVE-2018-8779 and CVE-2018-8780 are tested in specs.
JRuby tracks latest RubyGems and was updated recently (#6533)
Buffer underruns will result in JVM exceptions on JRuby and do not constitute a memory vulnerability (and we did not have these bugs to begin with).
JRuby is unaffected due to the impossibility of exposing raw heap state to the Java-based JSON extension. We also track the latest json gem, which has a Java implementation for JRuby less subject to memory vulnerabilities.
JRuby implements Psych (which wraps libyaml in CRuby) using SnakeYAML, and is current as of recent releases of Psych.
JRuby tracks the latest net-ftp gem.
This is the aforementioned failure in security specs. Tainting is no longer a supported feature, even in CRuby.
JRuby was unaffected and passes the relevant tests, added in 9619fca.
JRuby tracks the latest rdoc gem.
JRuby tracks the latest shell gem.
Another case where the JVM protects us from exposing the raw heap. JRuby's socket library largely uses JDK sockets in 9.3.
JRuby tracks the latest rexml gem. |
Given that all CVEs to date appear to be addressed by using latest gems, latest copies from stdlib, or involve C-level vulnerabilities, I am calling this one fixed as of 9.3. |
Great work, thanks @headius! |
I'm maintaining Ruby installations for a client on a regular basis (including both MRI & JRuby on various servers).
MRI got multiple releases to cover multiple CVEs:
Before that, MRI got other fixes recently:
I wondered what the situation is for JRuby with regard to the related CVEs.
The JRuby security page doesn't mention recent CVEs, and the news page hasn't had one for a while if I'm not mistaken.
Does this means that JRuby is unaffected (e.g. if it uses different, underlying JVM components rather than pure Ruby code), or that the evaluation hasn't necessarily been conducted so situation is unknown?
I don't know if opening an issue is the way to go for this, but I thought it is worth clarifying, so this could start a discussion!
Thanks for your work on JRuby.
The text was updated successfully, but these errors were encountered: