Ruby up to 2.1.2 pack.c encodes memory corruption

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
6.3$0-$5k0.00

A vulnerability, which was classified as critical, was found in Ruby up to 2.1.2 (Programming Language Software). Affected is the function encodes of the file pack.c. The manipulation with an unknown input leads to a memory corruption vulnerability. CWE is classifying the issue as CWE-119. The product performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer. This is going to have an impact on confidentiality, integrity, and availability.

The weakness was presented 07/10/2014 by Will Wood as Bug 1118158 as not defined bug report (Bugzilla). The advisory is shared for download at bugzilla.redhat.com. This vulnerability is traded as CVE-2014-4975 since 07/15/2014. The exploitability is told to be easy. It is possible to launch the attack remotely. The exploitation doesn't require any form of authentication. Technical details and a public exploit are known. The reason for this vulnerability is this part of code:

char buff[4096];

A public exploit has been developed by Tomas Hoger in Ruby and been published immediately after the advisory. The exploit is shared for download at bugzilla.redhat.com. It is declared as proof-of-concept. The vulnerability scanner Nessus provides a plugin with the ID 78869 (Ubuntu 12.04 LTS / 14.04 LTS / 14.10 : ruby1.8, ruby1.9.1, ruby2.0, ruby2.1 vulnerabilities (USN-2397-1)), which helps to determine the existence of the flaw in a target environment. It is assigned to the family Ubuntu Local Security Checks. The commercial vulnerability scanner Qualys is able to test this issue with plugin 122868 (Red Hat Update for ruby (RHSA-2014:1912)). The code used by the exploit is:

["a"*3070].pack("m4000")
["a"*(3072*3-2)].pack("m3072")

Applying a patch is able to eliminate this problem. The bugfix is ready for download at svn.ruby-lang.org. A possible mitigation has been published 1 days after the disclosure of the vulnerability. The vulnerability will be addressed with the following lines of code:

enum {buff_size = 4096, encoded_unit = 4};
char buff[buff_size + 1];	/* +1 for tail_lf */

The vulnerability is also documented in the databases at X-Force (94706) and Tenable (78869). See 68264 for similar entry.

Productinfo

Type

Name

Version

License

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB CVSS-B Score: 🔍
VulDB CVSS-BT Score: 🔍
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 7.3
VulDB Meta Temp Score: 6.3

VulDB Base Score: 7.3
VulDB Temp Score: 6.3
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
unlockunlockunlockunlockunlockunlock
unlockunlockunlockunlockunlockunlock
unlockunlockunlockunlockunlockunlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍

Exploitinginfo

Class: Memory corruption
CWE: CWE-119
ATT&CK: Unknown

Local: No
Remote: Yes

Availability: 🔍
Access: Public
Status: Proof-of-Concept
Author: Tomas Hoger
Programming Language: 🔍
Download: 🔍

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-Dayunlockunlockunlockunlock
Todayunlockunlockunlockunlock

Nessus ID: 78869
Nessus Name: Ubuntu 12.04 LTS / 14.04 LTS / 14.10 : ruby1.8, ruby1.9.1, ruby2.0, ruby2.1 vulnerabilities (USN-2397-1)
Nessus File: 🔍
Nessus Risk: 🔍
Nessus Family: 🔍
Nessus Port: 🔍

OpenVAS ID: 801375
OpenVAS Name: Ruby encodes function Denial-of-Service Vulnerability (Windows)
OpenVAS File: 🔍
OpenVAS Family: 🔍

Qualys ID: 🔍
Qualys Name: 🔍

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Patch
Status: 🔍

Reaction Time: 🔍
0-Day Time: 🔍
Exposure Time: 🔍
Exploit Delay Time: 🔍

Patch: svn.ruby-lang.org

Timelineinfo

07/09/2014 🔍
07/09/2014 +0 days 🔍
07/10/2014 +1 days 🔍
07/10/2014 +0 days 🔍
07/11/2014 +1 days 🔍
07/15/2014 +4 days 🔍
07/20/2014 +5 days 🔍
11/05/2014 +108 days 🔍
11/05/2014 +0 days 🔍
11/15/2014 +10 days 🔍
12/03/2014 +18 days 🔍
02/09/2022 +2625 days 🔍

Sourcesinfo

Advisory: Bug 1118158
Researcher: Will Wood
Status: Not defined
Confirmation: 🔍

CVE: CVE-2014-4975 (🔍)
OVAL: 🔍

X-Force: 94706 - Ruby encodes() function buffer overflow, High Risk
SecurityTracker: 1031167 - Ruby Stack Overflow in encodes() Function May Let Remote Users Execute Arbitrary Code
Vulnerability Center: 47400 - Ruby <=1.9.3, 2.0 - 2.1.2 pack.c Remote DoS Vulnerability due to Stack-Based Buffer Overflow, Medium
SecurityFocus: 68474 - Ruby 'pack.c' Buffer Overflow Vulnerability

scip Labs: https://www.scip.ch/en/?labs.20161013
See also: 🔍

Entryinfo

Created: 07/20/2014 09:52
Updated: 02/09/2022 16:24
Changes: 07/20/2014 09:52 (96), 06/13/2017 08:48 (1), 02/09/2022 16:16 (3), 02/09/2022 16:24 (1)
Complete: 🔍

Discussion

No comments yet. Languages: en.

Please log in to comment.

Might our Artificial Intelligence support you?

Check our Alexa App!