First published: Tue Oct 01 2019(Updated: )
Ruby through 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4 mishandles path checking within File.fnmatch functions.
Credit: cve@mitre.org cve@mitre.org
Affected Software | Affected Version | How to fix |
---|---|---|
redhat/rh-ruby25-ruby | <0:2.5.9-9.el7 | 0:2.5.9-9.el7 |
redhat/rh-ruby26-ruby | <0:2.6.7-119.el7 | 0:2.6.7-119.el7 |
Ruby-lang Ruby | >=2.4.0<=2.4.7 | |
Ruby-lang Ruby | >=2.5.0<=2.5.6 | |
Ruby-lang Ruby | >=2.6.0<=2.6.4 | |
Canonical Ubuntu Linux | =16.04 | |
Canonical Ubuntu Linux | =18.04 | |
Canonical Ubuntu Linux | =19.04 | |
Canonical Ubuntu Linux | =19.10 | |
redhat/ruby | <2.4.8 | 2.4.8 |
redhat/ruby | <2.5.7 | 2.5.7 |
redhat/ruby | <2.6.5 | 2.6.5 |
redhat/ruby | <2.7.0 | 2.7.0 |
ubuntu/ruby2.3 | <2.3.1-2~ubuntu16.04.14 | 2.3.1-2~ubuntu16.04.14 |
ubuntu/ruby2.5 | <2.5.1-1ubuntu1.6 | 2.5.1-1ubuntu1.6 |
ubuntu/ruby2.5 | <2.5.5-1ubuntu1.1 | 2.5.5-1ubuntu1.1 |
ubuntu/ruby2.5 | <2.5.5-4ubuntu2.1 | 2.5.5-4ubuntu2.1 |
ubuntu/ruby2.5 | <2.5.7-1 | 2.5.7-1 |
debian/jruby | 9.3.9.0+ds-8 9.4.8.0+ds-1 |
It is possible to test for presence of the NULL byte manually prior to call the affected methods with an untrusted string.
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
(Appears in the following advisories)
The vulnerability ID for this flaw is CVE-2019-15845.
The severity level of CVE-2019-15845 is medium.
The affected software versions are Ruby 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4.
An attacker can exploit this vulnerability by making a Ruby script process a specially crafted path pattern containing a NULL byte.
More information about CVE-2019-15845 can be found at the following references: [Link 1](https://www.ruby-lang.org/en/news/2019/10/01/nul-injection-file-fnmatch-cve-2019-15845/), [Link 2](https://hackerone.com/reports/449617), [Link 3](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=1789408).