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...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-15845
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1789408 1796784 1796785 1796786 1796787 1796788 1796789 1954949 1955053 1957122 2055232 2055241
Blocks: 1789409
TreeView+ depends on / blocked
 
Reported: 2020-01-09 13:58 UTC by Guilherme de Almeida Suckevicz
Modified: 2022-02-21 10:11 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:
Environment:
Last Closed: 2021-05-26 11:32:05 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:2587 0 None None None 2021-06-29 16:03:23 UTC
Red Hat Product Errata RHSA-2021:2588 0 None None None 2021-06-29 16:04:06 UTC
Red Hat Product Errata RHSA-2022:0581 0 None None None 2022-02-21 10:10:56 UTC
Red Hat Product Errata RHSA-2022:0582 0 None None None 2022-02-21 10:11:55 UTC

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.

References:
https://www.ruby-lang.org/en/news/2019/10/01/nul-injection-file-fnmatch-cve-2019-15845/
https://hackerone.com/reports/449617

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:
https://github.com/ruby/ruby/commit/a0a2640b398cffd351f87d3f6243103add66575b

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

https://www.ruby-lang.org/en/news/2019/10/01/nul-injection-file-fnmatch-cve-2019-15845/

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

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

Comment 8 errata-xmlrpc 2021-05-25 13:14:03 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

Via RHSA-2021:2104 https://access.redhat.com/errata/RHSA-2021:2104

Comment 9 Product Security DevOps Team 2021-05-26 11:32:05 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-15845

Comment 10 errata-xmlrpc 2021-06-03 11:25:49 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.7 EUS

Via RHSA-2021:2230 https://access.redhat.com/errata/RHSA-2021:2230

Comment 11 errata-xmlrpc 2021-06-29 16:03:20 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:2587 https://access.redhat.com/errata/RHSA-2021:2587

Comment 12 errata-xmlrpc 2021-06-29 16:04:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:2588 https://access.redhat.com/errata/RHSA-2021:2588

Comment 13 errata-xmlrpc 2022-02-21 10:10:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.1 Update Services for SAP Solutions

Via RHSA-2022:0581 https://access.redhat.com/errata/RHSA-2022:0581

Comment 14 errata-xmlrpc 2022-02-21 10:11:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.2 Extended Update Support

Via RHSA-2022:0582 https://access.redhat.com/errata/RHSA-2022:0582


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