Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 873664 (CVE-2016-2338)

Summary: dev-lang/ruby: heap buffer overflow
Product: Gentoo Security Reporter: John Helmert III <ajak>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Status: RESOLVED FIXED    
Severity: normal CC: ruby
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.talosintelligence.com/reports/TALOS-2016-0032/
Whiteboard:
Package list:
Runtime testing required: ---

Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-09-30 15:17:15 UTC
CVE-2016-2338 (https://lists.debian.org/debian-lts-announce/2020/03/msg00032.html):

An exploitable heap overflow vulnerability exists in the Psych::Emitter start_document function of Ruby. In Psych::Emitter start_document function heap buffer "head" allocation is made based on tags array length. Specially constructed object passed as element of tags array can increase this array size after mentioned allocation and cause heap overflow.

So this is an issue made public all the way back in 2016, but of
course no apparent upstream report. Was this ever fixed upstream?
Comment 1 Hans de Graaff gentoo-dev Security 2022-10-02 17:12:50 UTC
Looks to be fixed in https://github.com/ruby/ruby/commit/cc0313436160b735a3d41361cb5e3eeb10fcbdad which should be in ruby 2.4 and later, and possible 2.3.

The POC in the original bug report runs fine for me without crashes.
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-10-03 21:34:46 UTC
Thanks!