Quantum Secular Labs / Blog / Advisories
CVE-2017-0898: Ruby Lang: Buffer overflow
CVE-2017-0898 is rated critical with a CVSS v3.0 base score of 9.1 and affects Ruby Lang. Per its scoring, it can be exploited over the network, without authentication, without any user interaction.
Vulnerability description
Ruby before 2.4.2, 2.3.5, and 2.2.8 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.
Severity breakdown
CVSS v3.0 9.1: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
- Attack vector: Network. Exploitable remotely over the network, with no need for local or physical access.
- Attack complexity: Low. No special conditions; the attack can be repeated reliably.
- Privileges required: None. No account or prior access is needed.
- User interaction: None. No action from any user is needed.
- Scope: Unchanged. Impact stays within the vulnerable component.
- Confidentiality impact: High. Total loss of confidentiality; sensitive data can be fully disclosed.
- Integrity impact: None. No loss of integrity.
- Availability impact: High. Total loss of availability; the component can be shut down.
Underlying weakness
CWE-134: Use of Externally-Controlled Format String
The product uses a function that accepts a format string as an argument, but the format string originates from an external source.
Affected products
- Ruby Lang: 2.2.0; 2.2.1; 2.2.2; 2.2.3; 2.2.4; 2.2.5; 2.2.6; 2.2.7; 2.3.0; 2.3.1; 2.3.2; 2.3.3
References
- https://www.ruby-lang.org/en/news/2017/09/14/sprintf-buffer-underrun-cve-2017-0898/
- http://www.securityfocus.com/bid/100862
- http://www.securitytracker.com/id/1039363
- https://github.com/mruby/mruby/issues/3722
- https://hackerone.com/reports/212241
- https://access.redhat.com/errata/RHSA-2017:3485
- https://access.redhat.com/errata/RHSA-2018:0378
- https://access.redhat.com/errata/RHSA-2018:0583
- https://access.redhat.com/errata/RHSA-2018:0585
- https://lists.debian.org/debian-lts-announce/2018/07/msg00012.html
- https://security.gentoo.org/glsa/201710-18
- https://usn.ubuntu.com/3685-1/
- https://www.debian.org/security/2017/dsa-4031