{"id":"CVE-2016-2338","aliases":["CLSA-2025-1757699919","DEBIAN-CVE-2016-2338","DLA-2158-1","EUVD-2016-3422","GHSA-r46x-xjwr-8v2g","UBUNTU-CVE-2016-2338"],"status":"published","title":"An exploitable heap overflow vulnerability exists in the Psych::Emitter start_document function...","description":"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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-08","score":0.04741,"percentile":0.91925,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-787"],"published":"2020-02-14T00:00:00Z","modified":"2026-10-24T10:30:37Z","exploits":[{"source":"pocgithub","id":"SpiralBL0CK/CVE-2016-2338-nday","title":"SpiralBL0CK/CVE-2016-2338-nday","date":"2022-12-19","url":"https://github.com/SpiralBL0CK/CVE-2016-2338-nday"}],"fixes":[{"ecosystem":"TuxCare:CentOS:7","package":"ruby","fixed_in":["2.0.0.648-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"ruby-devel","fixed_in":["2.0.0.648-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"ruby-doc","fixed_in":["2.0.0.648-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"ruby-irb","fixed_in":["2.0.0.648-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"ruby-libs","fixed_in":["2.0.0.648-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"ruby-tcltk","fixed_in":["2.0.0.648-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-bigdecimal","fixed_in":["1.2.0-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-io-console","fixed_in":["0.4.2-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-json","fixed_in":["1.7.7-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-minitest","fixed_in":["4.3.2-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-psych","fixed_in":["2.0.0-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-rake","fixed_in":["0.9.6-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygem-rdoc","fixed_in":["4.0.0-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygems","fixed_in":["2.0.14.1-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"TuxCare:CentOS:7","package":"rubygems-devel","fixed_in":["2.0.14.1-39.el7_9.tuxcare.els9"],"sources":["osv"]},{"ecosystem":"Debian:8","package":"ruby2.1","fixed_in":["2.1.5-2+deb8u9"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"ruby","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0.648-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"ruby-devel","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0.648-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"ruby-doc","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0.648-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"ruby-irb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0.648-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"ruby-libs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0.648-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"ruby-tcltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0.648-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-bigdecimal","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.0-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-io-console","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.4.2-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-json","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.7.7-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-minitest","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.3.2-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-psych","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-rake","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.9.6-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygem-rdoc","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.0-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygems","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.14.1-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"TuxCare:CentOS:7","package":"rubygems-devel","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.14.1-39.el7_9.tuxcare.els9"}]}]},{"source":"osv","ecosystem":"Debian:8","package":"ruby2.1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1.5-2+deb8u9"}]}],"versions":["2.1.5-2","2.1.5-2+deb8u1","2.1.5-2+deb8u2","2.1.5-2+deb8u3","2.1.5-2+deb8u4","2.1.5-2+deb8u5","2.1.5-2+deb8u6","2.1.5-2+deb8u7","2.1.5-2+deb8u8"]}],"products":[{"vendor":"debian","product":"debian_linux"},{"vendor":"ruby-lang","product":"ruby"}],"references":[{"url":"https://lists.debian.org/debian-lts-announce/2020/03/msg00032.html","tags":["mailing-list","x_transferred","Mailing List","Third Party Advisory","advisory"]},{"url":"http://www.talosintelligence.com/reports/TALOS-2016-0032/","tags":["x_transferred","Exploit","Third Party Advisory","evidence","report"]},{"url":"https://security.netapp.com/advisory/ntap-20221228-0005/","tags":["x_transferred","Third Party Advisory","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2016-2338"},{"url":"https://github.com/advisories/GHSA-r46x-xjwr-8v2g"},{"url":"https://errata.tuxcare.com/els_os/centos7els/CLSA-2025-1757699919.html","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2016-2338","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2016-2338","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2016-2338","description":"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.","status":"published","published":"2020-02-14T00:00:00Z","modified":"2024-08-05T23:24:48.961Z","updated_at":"2026-11-02T14:33:33.07583Z"}],"euvd":[{"id":"EUVD-2016-3422","description":"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.","status":"published","published":"2020-02-14T00:00:00Z","modified":"2024-08-05T23:24:48Z","updated_at":"2026-11-03T02:22:53.601545Z"}],"ghsa":[{"id":"GHSA-r46x-xjwr-8v2g","title":"An exploitable heap overflow vulnerability exists in the Psych::Emitter start_document function...","description":"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.","status":"published","published":"2022-09-30T00:00:34Z","modified":"2023-01-28T05:06:59Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-787"],"updated_at":"2026-11-02T14:44:29.269512Z"}],"nvd":[{"id":"CVE-2016-2338","description":"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.","status":"published","published":"2022-09-29T03:15:11.47Z","modified":"2026-06-17T00:43:51.027Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-787"],"updated_at":"2026-11-02T14:03:40.811555Z"}],"osv":[{"id":"CVE-2016-2338","description":"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.","status":"published","published":"2022-09-29T03:15:11.47Z","modified":"2026-10-24T10:30:37.645383969Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:02.114472Z"},{"id":"UBUNTU-CVE-2016-2338","description":"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.","status":"withdrawn","published":"2022-09-29T03:15:00Z","modified":"2025-07-16T08:12:06.954164Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:54:11.872222Z"},{"id":"CLSA-2025-1757699919","title":"ruby: Fix of CVE-2016-2338","description":"- CVE-2016-2338: fix heap overflow vulnerability in start_document function","status":"published","published":"2025-09-12T17:58:43Z","modified":"2026-06-01T00:33:18.184144928Z","updated_at":"2026-11-02T15:43:42.025438Z"},{"id":"DLA-2158-1","title":"ruby2.1 - security update","status":"published","published":"2020-03-25T00:00:00Z","modified":"2026-03-09T01:23:28.615283Z","updated_at":"2026-11-02T15:46:10.227108Z"}]}}
