CVE-2017-14064: Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call.
Critical CVSS 9.8
- CVE id
- CVE-2017-14064
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| Ruby Runtimes and servers |
<= 2.2.7 | after 2.2.7 |
How to fix it
Upgrade Ruby to a release newer than 2.2.7.
ruby --version
- Install the patched Ruby release of your minor line (rbenv, the ruby image tag) and update .ruby-version.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call. The issues lies in using strdup in ext/json/ext/generator/generator.c, which will stop after encountering a '\0' byte, returning a pointer to a string of length zero, which is not the length stored in space_len.
References
- CVE-2017-14064 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2017-14064
- Web: https://access.redhat.com/errata/RHSA-2017:3485
- Web: https://access.redhat.com/errata/RHSA-2018:0378
- Web: https://access.redhat.com/errata/RHSA-2018:0583
- Web: https://access.redhat.com/errata/RHSA-2018:0585
- Web: https://bugs.ruby-lang.org/issues/13853
- Web: https://github.com/flori/json/commit/8f782fd8e181d9cfe9387ded43a5ca9692266b85
- Web: https://hackerone.com/reports/209949
- Web: https://lists.debian.org/debian-lts-announce/2018/07/msg00012.html
- Web: https://security.gentoo.org/glsa/201710-18
- Web: https://usn.ubuntu.com/3685-1/
- Web: https://www.debian.org/security/2017/dsa-3966
- Web: https://www.ruby-lang.org/en/news/2017/09/14/ruby-2-2-8-released/
- Web: https://www.ruby-lang.org/en/news/2017/09/14/ruby-2-3-5-released/
- Web: https://access.redhat.com/errata/RHSA-2017:3485
- Web: https://access.redhat.com/errata/RHSA-2018:0378
- Web: https://access.redhat.com/errata/RHSA-2018:0583
- Web: https://access.redhat.com/errata/RHSA-2018:0585
- Web: https://bugs.ruby-lang.org/issues/13853
- Web: https://github.com/flori/json/commit/8f782fd8e181d9cfe9387ded43a5ca9692266b85
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.