Bug 1789407 (CVE-2019-15845) - CVE-2019-15845 ruby: NUL injection vulnerability of File.fnmatch and File.fnmatch?
Summary: CVE-2019-15845 ruby: NUL injection vulnerability of File.fnmatch and File.fnm...
Status: NEW
Alias: CVE-2019-15845
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1789408 1796784 1796785 1796786 1796787 1796788 1796789
Blocks: 1789409
TreeView+ depends on / blocked
Reported: 2020-01-09 13:58 UTC by Guilherme de Almeida Suckevicz
Modified: 2020-04-23 19:17 UTC (History)
13 users (show)

Fixed In Version: ruby 2.4.8, ruby 2.5.7, ruby 2.6.5, ruby 2.7.0
Doc Type: If docs needed, set a value
Doc Text:
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.
Clone Of:
Last Closed:

Attachments (Terms of Use)

Description Guilherme de Almeida Suckevicz 2020-01-09 13:58:32 UTC
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.


Comment 1 Guilherme de Almeida Suckevicz 2020-01-09 13:59:30 UTC
Created ruby tracking bugs for this issue:

Affects: fedora-all [bug 1789408]

Comment 2 Mauro Matteo Cascella 2020-01-30 14:45:38 UTC
Upstream fix:

Comment 3 Mauro Matteo Cascella 2020-01-30 15:07:57 UTC
External References:


Comment 6 Mauro Matteo Cascella 2020-01-31 09:20:48 UTC

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

Note You need to log in before you can comment on or make changes to this bug.