CVE-2019-15845: Medium severity ruby-lang Ruby vulnerability

Published Oct 1, 2019
·
Updated

A flaw was discovered in Ruby in the way certain functions handled strings containing NULL bytes. Specifically, the built-in methods File.fnmatch and its alias File.fnmatch? did not properly handle path patterns containing the NULL byte. A remote attacker could exploit this flaw to make a Ruby script access unexpected files and to bypass intended file system access restrictions.

Other sources

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.

Affected Software

14 affected componentsFixes available
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
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
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
debian/jruby
9.3.9.0+ds-89.4.8.0+ds-3

Remediation

Information

It is possible to test for presence of the NULL byte manually prior to call the affected methods with an untrusted string.

Event History

Oct 1, 2019
CVE Published
12:00 AM
Nov 26, 2019
CVE Published
via MITRE·04:45 PM
Data Sourced
via MITRE·04:45 PM
Description
Data Sourced
via NVD·05:15 PM
DescriptionSeverityAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·11:20 PM
Description
Feb 20, 2026
Data Sourced
via Ubuntu·11:43 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Debian·11:44 PM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the vulnerability ID for this flaw?

The vulnerability ID for this flaw is CVE-2019-15845.

2

What is the severity level of CVE-2019-15845?

The severity level of CVE-2019-15845 is medium.

3

Which software versions are affected by this vulnerability?

The affected software versions are Ruby 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4.

4

How can an attacker exploit this vulnerability?

An attacker can exploit this vulnerability by making a Ruby script process a specially crafted path pattern containing a NULL byte.

5

Where can I find more information about CVE-2019-15845?

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).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203