UNIXServer.open accepts the path of the socket to be created at the first parameter. If the path contains NUL (\0) bytes, this method recognize that the path is completed before the NUL bytes. So, if a script accepts an external input as the argument of this method, the attacker can make the socket file in the unintentional path. And, UNIXSocket.open also accepts the path of the socket to be created at the first parameter without checking NUL bytes like UNIXServer.open. So, if a script accepts an external input as the argument of this method, the attacker can accepts the socket file in the unintentional path. Affected versions: Ruby 2.2 series: 2.2.9 and earlier Ruby 2.3 series: 2.3.6 and earlier Ruby 2.4 series: 2.4.3 and earlier Ruby 2.5 series: 2.5.0 and earlier External References: https://www.ruby-lang.org/en/news/2018/03/28/poisoned-nul-byte-unixsocket-cve-2018-8779/
Created ruby tracking bugs for this issue: Affects: fedora-all [bug 1561957]
Upstream fix : https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62991
Mitigation: It is possible to test for presence of the NULL byte manually prior to call the affected methods.
ruby version 1.8 does not appear to be vulnerable : the method correctly triggers an ArgumentError.
Statement: This issue did not affect the versions of ruby as shipped with Red Hat Enterprise Linux 5 and 6.
> Upstream fix : > https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62991 Above shows r62991. It is better to add r63000 too. trunk branch r62991: https://github.com/ruby/ruby/commit/8794dec6a5f11adc5cdd19a5ee91ea6b0816763f r63000: https://github.com/ruby/ruby/commit/b78fa27ae0b717c5569878c106a67d5047e5fb88 > Ruby 2.2 series: 2.2.9 and earlier ruby_2_2 branch: A commit merged from both r62991 and r63000. https://github.com/ruby/ruby/commit/47165eed264d357e78e27371cfef20d5c2bde5d9 > Ruby 2.3 series: 2.3.6 and earlier > Ruby 2.4 series: 2.4.3 and earlier > Ruby 2.5 series: 2.5.0 and earlier Search by below string. ``` merge revision(s) 62991,63000: unixsocket.c: check NUL bytes unixsocket.c: abstract namespace ```
This issue has been addressed in the following products: Red Hat Software Collections for Red Hat Enterprise Linux 6 Red Hat Software Collections for Red Hat Enterprise Linux 7 Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS Via RHSA-2018:3729 https://access.redhat.com/errata/RHSA-2018:3729
This issue has been addressed in the following products: Red Hat Software Collections for Red Hat Enterprise Linux 6 Red Hat Software Collections for Red Hat Enterprise Linux 7 Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS Via RHSA-2018:3730 https://access.redhat.com/errata/RHSA-2018:3730
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.4 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS Via RHSA-2018:3731 https://access.redhat.com/errata/RHSA-2018:3731
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2019:2028 https://access.redhat.com/errata/RHSA-2019:2028