Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873664 (CVE-2016-2338) - dev-lang/ruby: heap buffer overflow
Summary: dev-lang/ruby: heap buffer overflow
Alias: CVE-2016-2338
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
Depends on:
Reported: 2022-09-30 15:17 UTC by John Helmert III
Modified: 2022-10-03 21:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-09-30 15:17:15 UTC
CVE-2016-2338 (

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 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