ALAS-2017-906


Amazon Linux AMI Security Advisory: ALAS-2017-906
Advisory Release Date: 2018-01-18 20:17 Pacific
Severity: Medium

Issue Overview:

SMTP command injection via CRLF sequences in RCPT TO or MAIL FROM commands in Net::SMTP
A SMTP command injection flaw was found in the way Ruby's Net::SMTP module handled CRLF sequences in certain SMTP commands. An attacker could potentially use this flaw to inject SMTP commands in a SMTP session in order to facilitate phishing attacks or spam campaigns. (CVE-2015-9096 )

Escape sequence injection vulnerability in the Basic authentication of WEBrick
The Basic authentication code in WEBrick library in Ruby allows remote attackers to inject terminal emulator escape sequences into its log and possibly execute arbitrary commands via a crafted user name. (CVE-2017-10784 )

Buffer underrun in OpenSSL ASN1 decode
The decode method in the OpenSSL::ASN1 module in Ruby allows attackers to cause a denial of service (interpreter crash) via a crafted string. (CVE-2017-14033 )

No size limit in summary length of gem spec
RubyGems is vulnerable to maliciously crafted gem specifications to cause a denial of service attack against RubyGems clients who have issued a `query` command. (CVE-2017-0900 )

Arbitrary file overwrite due to incorrect validation of specification name
RubyGems fails to validate specification names, allowing a maliciously crafted gem to potentially overwrite any file on the filesystem. (CVE-2017-0901 )

DNS hijacking vulnerability
RubyGems is vulnerable to a DNS hijacking vulnerability that allows a MITM attacker to force the RubyGems client to download and install gems from a server that the attacker controls. (CVE-2017-0902 )

Buffer underrun vulnerability in Kernel.sprintf
Ruby is vulnerable to a malicious format string which contains a precious specifier (*) with a huge minus value. Such situation can lead to a buffer overrun, resulting in a heap memory corruption or an information disclosure from the heap. (CVE-2017-0898 )

Escape sequence in the "summary" field of gemspec
RubyGems is vulnerable to maliciously crafted gem specifications that include terminal escape characters. Printing the gem specification would execute terminal escape sequences. (CVE-2017-0899 )

Arbitrary heap exposure during a JSON.generate call
Ruby can expose arbitrary memory during a JSON.generate call. The issues lies in using strdup in ext/json/ext/generator/generator.c, which will stop after encountering a '\\0' byte, returning a pointer to a string of length zero, which is not the length stored in space_len. (CVE-2017-14064 )

A vulnerability was found where the rubygems module was vulnerable to an unsafe YAML deserialization when inspecting a gem. Applications inspecting gem files without installing them can be tricked to execute arbitrary code in the context of the ruby interpreter. (CVE-2017-0903 )


Affected Packages:

ruby22,ruby23


Issue Correction:
Run yum update ruby22 to update your system.
Run yum update ruby23 to update your system.

New Packages:
i686:
    ruby22-libs-2.2.8-1.9.amzn1.i686
    rubygem22-psych-2.0.8.1-1.9.amzn1.i686
    ruby22-debuginfo-2.2.8-1.9.amzn1.i686
    ruby22-2.2.8-1.9.amzn1.i686
    ruby22-devel-2.2.8-1.9.amzn1.i686
    rubygem22-io-console-0.4.3-1.9.amzn1.i686
    rubygem22-bigdecimal-1.2.6-1.9.amzn1.i686
    rubygem23-psych-2.1.0.1-1.17.amzn1.i686
    rubygem23-io-console-0.4.5-1.17.amzn1.i686
    rubygem23-json-1.8.3.1-1.17.amzn1.i686
    ruby23-devel-2.3.5-1.17.amzn1.i686
    ruby23-debuginfo-2.3.5-1.17.amzn1.i686
    ruby23-2.3.5-1.17.amzn1.i686
    rubygem23-bigdecimal-1.2.8-1.17.amzn1.i686
    ruby23-libs-2.3.5-1.17.amzn1.i686

noarch:
    ruby22-irb-2.2.8-1.9.amzn1.noarch
    rubygems22-devel-2.4.5.2-1.9.amzn1.noarch
    rubygems22-2.4.5.2-1.9.amzn1.noarch
    ruby22-doc-2.2.8-1.9.amzn1.noarch
    ruby23-doc-2.3.5-1.17.amzn1.noarch
    rubygem23-did_you_mean-1.0.0-1.17.amzn1.noarch
    rubygems23-devel-2.5.2.1-1.17.amzn1.noarch
    rubygems23-2.5.2.1-1.17.amzn1.noarch
    ruby23-irb-2.3.5-1.17.amzn1.noarch

src:
    ruby22-2.2.8-1.9.amzn1.src
    ruby23-2.3.5-1.17.amzn1.src

x86_64:
    ruby22-2.2.8-1.9.amzn1.x86_64
    ruby22-devel-2.2.8-1.9.amzn1.x86_64
    ruby22-debuginfo-2.2.8-1.9.amzn1.x86_64
    rubygem22-bigdecimal-1.2.6-1.9.amzn1.x86_64
    ruby22-libs-2.2.8-1.9.amzn1.x86_64
    rubygem22-psych-2.0.8.1-1.9.amzn1.x86_64
    rubygem22-io-console-0.4.3-1.9.amzn1.x86_64
    rubygem23-json-1.8.3.1-1.17.amzn1.x86_64
    ruby23-debuginfo-2.3.5-1.17.amzn1.x86_64
    rubygem23-psych-2.1.0.1-1.17.amzn1.x86_64
    ruby23-libs-2.3.5-1.17.amzn1.x86_64
    ruby23-2.3.5-1.17.amzn1.x86_64
    rubygem23-bigdecimal-1.2.8-1.17.amzn1.x86_64
    rubygem23-io-console-0.4.5-1.17.amzn1.x86_64
    ruby23-devel-2.3.5-1.17.amzn1.x86_64