ALAS-2019-1255

Related Vulnerabilities: CVE-2019-8320   CVE-2019-8321   CVE-2019-8322   CVE-2019-8323   CVE-2019-8324   CVE-2019-8325  

An issue was discovered in RubyGems. The gem owner command outputs the contents of the API response directly to stdout. Therefore, if the response is crafted, escape sequence injection may occur.(CVE-2019-8322) An issue was discovered in RubyGems. Gem::GemcutterUtilities#with_response may output the API response to stdout as it is. Therefore, if the API side modifies the response, escape sequence injection may occur.(CVE-2019-8323) An issue was discovered in RubyGems. Since Gem::UserInteraction#verbose calls say without escaping, escape sequence injection is possible.(CVE-2019-8321) A Directory Traversal issue was discovered in RubyGems. Before making new directories or touching files (which now include path-checking code for symlinks), it would delete the target destination. If that destination was hidden behind a symlink, a malicious gem could delete arbitrary files on the user's machine, presuming the attacker could guess at paths. Given how frequently gem is run as sudo, and how predictable paths are on modern systems (/tmp, /usr, etc.), this could likely lead to data loss or an unusable system.(CVE-2019-8320) An issue was discovered in RubyGems. A crafted gem with a multi-line name is not handled correctly. Therefore, an attacker could inject arbitrary code to the stub line of gemspec, which is eval-ed by code in ensure_loadable_spec during the preinstall check.(CVE-2019-8324) An issue was discovered in RubyGems. Since Gem::CommandManager#run calls alert_error without escaping, escape sequence injection is possible. (There are many ways to cause an error.)(CVE-2019-8325)

ALAS-2019-1255


Amazon Linux AMI Security Advisory: ALAS-2019-1255
Advisory Release Date: 2019-08-07 22:58 Pacific
Advisory Updated Date: 2019-08-12 18:13 Pacific
Severity: Important

Issue Overview:

An issue was discovered in RubyGems. The gem owner command outputs the contents of the API response directly to stdout. Therefore, if the response is crafted, escape sequence injection may occur.(CVE-2019-8322)

An issue was discovered in RubyGems. Gem::GemcutterUtilities#with_response may output the API response to stdout as it is. Therefore, if the API side modifies the response, escape sequence injection may occur.(CVE-2019-8323)

An issue was discovered in RubyGems. Since Gem::UserInteraction#verbose calls say without escaping, escape sequence injection is possible.(CVE-2019-8321)

A Directory Traversal issue was discovered in RubyGems. Before making new directories or touching files (which now include path-checking code for symlinks), it would delete the target destination. If that destination was hidden behind a symlink, a malicious gem could delete arbitrary files on the user's machine, presuming the attacker could guess at paths. Given how frequently gem is run as sudo, and how predictable paths are on modern systems (/tmp, /usr, etc.), this could likely lead to data loss or an unusable system.(CVE-2019-8320)

An issue was discovered in RubyGems. A crafted gem with a multi-line name is not handled correctly. Therefore, an attacker could inject arbitrary code to the stub line of gemspec, which is eval-ed by code in ensure_loadable_spec during the preinstall check.(CVE-2019-8324)

An issue was discovered in RubyGems. Since Gem::CommandManager#run calls alert_error without escaping, escape sequence injection is possible. (There are many ways to cause an error.)(CVE-2019-8325)


Affected Packages:

ruby20, ruby21, ruby24


Issue Correction:
Run yum update ruby20 to update your system.
Run yum update ruby21 to update your system.
Run yum update ruby24 to update your system.

New Packages:
i686:
    ruby20-libs-2.0.0.648-1.32.amzn1.i686
    ruby20-debuginfo-2.0.0.648-1.32.amzn1.i686
    rubygem20-bigdecimal-1.2.0-1.32.amzn1.i686
    ruby20-devel-2.0.0.648-1.32.amzn1.i686
    rubygem20-psych-2.0.0-1.32.amzn1.i686
    rubygem20-io-console-0.4.2-1.32.amzn1.i686
    ruby20-2.0.0.648-1.32.amzn1.i686
    ruby21-2.1.9-1.22.amzn1.i686
    rubygem21-bigdecimal-1.2.4-1.22.amzn1.i686
    ruby21-debuginfo-2.1.9-1.22.amzn1.i686
    rubygem21-io-console-0.4.3-1.22.amzn1.i686
    ruby21-devel-2.1.9-1.22.amzn1.i686
    rubygem21-psych-2.0.5-1.22.amzn1.i686
    ruby21-libs-2.1.9-1.22.amzn1.i686
    ruby24-2.4.5-1.30.11.amzn1.i686
    rubygem24-json-2.0.4-1.30.11.amzn1.i686
    rubygem24-bigdecimal-1.3.2-1.30.11.amzn1.i686
    ruby24-debuginfo-2.4.5-1.30.11.amzn1.i686
    rubygem24-io-console-0.4.6-1.30.11.amzn1.i686
    rubygem24-psych-2.2.2-1.30.11.amzn1.i686
    ruby24-libs-2.4.5-1.30.11.amzn1.i686
    rubygem24-xmlrpc-0.2.1-1.30.11.amzn1.i686
    ruby24-devel-2.4.5-1.30.11.amzn1.i686

noarch:
    ruby20-irb-2.0.0.648-1.32.amzn1.noarch
    ruby20-doc-2.0.0.648-1.32.amzn1.noarch
    rubygems20-devel-2.0.14.1-1.32.amzn1.noarch
    rubygems20-2.0.14.1-1.32.amzn1.noarch
    ruby21-irb-2.1.9-1.22.amzn1.noarch
    rubygems21-devel-2.2.5-1.22.amzn1.noarch
    ruby21-doc-2.1.9-1.22.amzn1.noarch
    rubygems21-2.2.5-1.22.amzn1.noarch
    rubygems24-2.6.14.3-1.30.11.amzn1.noarch
    rubygem24-did_you_mean-1.1.0-1.30.11.amzn1.noarch
    rubygems24-devel-2.6.14.3-1.30.11.amzn1.noarch
    ruby24-doc-2.4.5-1.30.11.amzn1.noarch
    ruby24-irb-2.4.5-1.30.11.amzn1.noarch

src:
    ruby20-2.0.0.648-1.32.amzn1.src
    ruby21-2.1.9-1.22.amzn1.src
    ruby24-2.4.5-1.30.11.amzn1.src

x86_64:
    ruby20-devel-2.0.0.648-1.32.amzn1.x86_64
    rubygem20-bigdecimal-1.2.0-1.32.amzn1.x86_64
    ruby20-debuginfo-2.0.0.648-1.32.amzn1.x86_64
    rubygem20-io-console-0.4.2-1.32.amzn1.x86_64
    ruby20-2.0.0.648-1.32.amzn1.x86_64
    rubygem20-psych-2.0.0-1.32.amzn1.x86_64
    ruby20-libs-2.0.0.648-1.32.amzn1.x86_64
    rubygem21-psych-2.0.5-1.22.amzn1.x86_64
    ruby21-devel-2.1.9-1.22.amzn1.x86_64
    ruby21-libs-2.1.9-1.22.amzn1.x86_64
    ruby21-debuginfo-2.1.9-1.22.amzn1.x86_64
    rubygem21-bigdecimal-1.2.4-1.22.amzn1.x86_64
    ruby21-2.1.9-1.22.amzn1.x86_64
    rubygem21-io-console-0.4.3-1.22.amzn1.x86_64
    rubygem24-json-2.0.4-1.30.11.amzn1.x86_64
    ruby24-devel-2.4.5-1.30.11.amzn1.x86_64
    ruby24-debuginfo-2.4.5-1.30.11.amzn1.x86_64
    rubygem24-bigdecimal-1.3.2-1.30.11.amzn1.x86_64
    rubygem24-io-console-0.4.6-1.30.11.amzn1.x86_64
    ruby24-2.4.5-1.30.11.amzn1.x86_64
    ruby24-libs-2.4.5-1.30.11.amzn1.x86_64
    rubygem24-xmlrpc-0.2.1-1.30.11.amzn1.x86_64
    rubygem24-psych-2.2.2-1.30.11.amzn1.x86_64