CVE-2014-4975
NoneCVSS
—
EPSS
3.5%
Published
Nov 15, 2014
CISA due date
—
Cloudanix analysis
A programming mistake in Ruby can make applications using it crash when they receive certain kinds of data, interrupting whatever service those applications provide.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Off-by-one error in the encodes function in pack.c triggers a stack-based buffer overflow when processing certain format string specifiers, resulting in a segmentation fault.
Why it matters to the business
Unexpected crashes in Ruby-based applications can interrupt services and require manual restarts, increasing operational overhead especially in environments still running unpatched 1.9.3 or 2.x releases.
How an attack unfolds
An attacker supplies a malicious format string containing specific specifiers to a Ruby application that invokes pack, overflowing the stack buffer and forcing a segmentation fault that terminates the process.
How to fix it
Upgrade Ruby to a version newer than 2.1.2 that contains the fix for the encodes function; apply vendor patches for affected Linux distributions and recompile or reinstall dependent applications.
How to confirm the fix worked
Verify installed Ruby version is newer than 2.1.2, then test pack operations with known triggering format specifiers to confirm absence of segfaults.
Typical attack path
- Locate a Ruby application or service that accepts attacker-controlled input for pack format strings
- Craft a format string that triggers the off-by-one condition
- Deliver the payload via network request or local input
- Cause the process to segfault and deny service
How to detect it
Review system and application logs for segmentation fault entries associated with Ruby processes; correlate with inbound requests containing pack format strings around the time of crashes.
What your security team should do
- Prioritize patching Ruby across all affected systems given the age of the flaw and continued presence in legacy deployments
- Audit application code for use of pack with untrusted format strings and replace with safe alternatives
- Implement runtime monitoring for Ruby process crashes and segment faults
The record
Off-by-one error in the encodes function in pack.c in Ruby 1.9.3 and earlier, and 2.x through 2.1.2, when using certain format string specifiers, allows context-dependent attackers to cause a denial of service (segmentation fault) via vectors that trigger a stack-based buffer overflow.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:6.0 | ruby1.9.1 | 0 | 1.9.2.0-2+deb6u3 |
| Debian:7 | ruby1.9.1 | 0 | 1.9.3.194-8.1+deb7u3 |
| Mageia:3 | ruby | 0 | 1.9.3.p551-1.mga3 |
| Mageia:4 | ruby | 0 | 2.0.0.p598-1.mga4 |
| Red Hat:enterprise_linux:7::client | ruby | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | ruby-debuginfo | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | ruby-devel | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | ruby-doc | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | ruby-irb | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | ruby-libs | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | ruby-tcltk | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-bigdecimal | 0 | 0:1.2.0-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-io-console | 0 | 0:0.4.2-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-json | 0 | 0:1.7.7-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-minitest | 0 | 0:4.3.2-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-psych | 0 | 0:2.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-rake | 0 | 0:0.9.6-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygem-rdoc | 0 | 0:4.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygems | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::client | rubygems-devel | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby-debuginfo | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby-devel | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby-doc | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby-irb | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby-libs | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | ruby-tcltk | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-bigdecimal | 0 | 0:1.2.0-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-io-console | 0 | 0:0.4.2-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-json | 0 | 0:1.7.7-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-minitest | 0 | 0:4.3.2-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-psych | 0 | 0:2.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-rake | 0 | 0:0.9.6-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygem-rdoc | 0 | 0:4.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygems | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::computenode | rubygems-devel | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby-debuginfo | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby-devel | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby-doc | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby-irb | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby-libs | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | ruby-tcltk | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-bigdecimal | 0 | 0:1.2.0-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-io-console | 0 | 0:0.4.2-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-json | 0 | 0:1.7.7-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-minitest | 0 | 0:4.3.2-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-psych | 0 | 0:2.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-rake | 0 | 0:0.9.6-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygem-rdoc | 0 | 0:4.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygems | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::server | rubygems-devel | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby-debuginfo | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby-devel | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby-doc | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby-irb | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby-libs | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | ruby-tcltk | 0 | 0:2.0.0.353-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-bigdecimal | 0 | 0:1.2.0-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-io-console | 0 | 0:0.4.2-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-json | 0 | 0:1.7.7-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-minitest | 0 | 0:4.3.2-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-psych | 0 | 0:2.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-rake | 0 | 0:0.9.6-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygem-rdoc | 0 | 0:4.0.0-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygems | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:enterprise_linux:7::workstation | rubygems-devel | 0 | 0:2.0.14-22.el7_0 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby-debuginfo | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby-devel | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby-doc | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby-irb | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby-libs | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-ruby-tcltk | 0 | 0:1.9.3.484-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygem-bigdecimal | 0 | 0:1.1.0-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygem-io-console | 0 | 0:0.3-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygem-json | 0 | 0:1.5.5-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygem-minitest | 0 | 0:2.5.1-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygem-rake | 0 | 0:0.9.2.2-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygem-rdoc | 0 | 0:3.9.5-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygems | 0 | 0:1.8.23-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby193-rubygems-devel | 0 | 0:1.8.23-50.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby-debuginfo | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby-devel | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby-doc | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby-irb | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby-libs | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-ruby-tcltk | 0 | 0:2.0.0.353-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-bigdecimal | 0 | 0:1.2.0-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-io-console | 0 | 0:0.4.2-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-json | 0 | 0:1.7.7-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-minitest | 0 | 0:4.3.2-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-psych | 0 | 0:2.0.0-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-rake | 0 | 0:0.9.6-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygem-rdoc | 0 | 0:4.0.0-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygems | 0 | 0:2.0.14-24.el6 |
| Red Hat:rhel_software_collections:1::el6 | ruby200-rubygems-devel | 0 | 0:2.0.14-24.el6 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby-debuginfo | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby-devel | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby-doc | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby-irb | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby-libs | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-ruby-tcltk | 0 | 0:1.9.3.484-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygem-bigdecimal | 0 | 0:1.1.0-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygem-io-console | 0 | 0:0.3-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygem-json | 0 | 0:1.5.5-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygem-minitest | 0 | 0:2.5.1-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygem-rake | 0 | 0:0.9.2.2-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygem-rdoc | 0 | 0:3.9.5-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygems | 0 | 0:1.8.23-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby193-rubygems-devel | 0 | 0:1.8.23-50.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby-debuginfo | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby-devel | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby-doc | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby-irb | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby-libs | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-ruby-tcltk | 0 | 0:2.0.0.353-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-bigdecimal | 0 | 0:1.2.0-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-io-console | 0 | 0:0.4.2-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-json | 0 | 0:1.7.7-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-minitest | 0 | 0:4.3.2-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-psych | 0 | 0:2.0.0-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-rake | 0 | 0:0.9.6-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygem-rdoc | 0 | 0:4.0.0-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygems | 0 | 0:2.0.14-24.el7 |
| Red Hat:rhel_software_collections:1::el7 | ruby200-rubygems-devel | 0 | 0:2.0.14-24.el7 |
| SUSE:Linux Enterprise Desktop 12 SP1 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Server 12 SP1 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Server 12 SP2 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | ruby2.1 | 0 | 2.1.9-15.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | ruby2.1 | 0 | 2.1.9-15.1 |
| Ubuntu:14.04:LTS | ruby1.9.1 | 0 | 1.9.3.484-2ubuntu1.1 |
| Ubuntu:14.04:LTS | ruby2.0 | 0 | 2.0.0.484-1ubuntu2.1 |
Related vulnerabilities
- CVE-2009-5147 DL::dlopen in Ruby 1.8, 1.9.0, 1.9.2, 1.9.3, 2.0.0 before patchlevel 648, and 2.1 before… Also affects ruby1.9.1
- CVE-2014-8090 The REXML parser in Ruby 1.9.x before 1.9.3 patchlevel 551, 2.0.x before 2.0.0 patchlevel… Also affects ruby1.9.1
- CVE-2013-4164 Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1… Also affects ruby1.9.1
- CVE-2013-0269 The JSON gem before 1.5.5, 1.6.x before 1.6.8, and 1.7.x before 1.7.7 for Ruby allows… Also affects ruby1.9.1
- CVE-2017-17405 Ruby before 2.4.3 allows Net::FTP command injection. Also affects ruby1.9.1
- CVE-2017-10784 The Basic authentication code in WEBrick library in Ruby before 2.2.8, 2.3.x before… Also affects ruby1.9.1
- CVE-2017-0898 Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which… Also affects ruby1.9.1
- CVE-2017-0901 RubyGems version 2.6.12 and earlier fails to validate specification names, allowing a… Also affects ruby1.9.1