Red Hat Bugzilla – Bug 1561948
CVE-2018-8779 ruby: Unintentional socket creation by poisoned NULL byte in UNIXServer and UNIXSocket
Last modified: 2018-07-17 08:36:10 EDT
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.