Vulnerability · Published Apr 5, 2022 · Assigned by GitHub_M

CVE-2022-24795Buffer Overflow and Integer Overflow in yajl-ruby

Medium 5.9

In plain English

A medium-severity heap buffer overflow in yajl-ruby from brianmario. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 3.4% (higher than 89% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.9Medium
Exploit odds (30 days)3.4%top 10.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

yajl-ruby is a C binding to the YAJL JSON parsing and generation library. The 1.x branch and the 2.x branch of `yajl` contain an integer overflow which leads to subsequent heap memory corruption when dealing with large (~2GB) inputs. The reallocation logic at `yajl_buf.c#L64` may result in the `need` 32bit integer wrapping to 0 when `need` approaches a value of 0x80000000 (i.e. ~2GB of data), which results in a reallocation of buf->alloc into a small heap chunk. These integers are declared as `size_t` in the 2.x branch of `yajl`, which practically prevents the issue from triggering on 64bit platforms, however this does not preclude this issue triggering on 32bit builds on which `size_t` is a 32bit integer. Subsequent population of this under-allocated heap chunk is based on the original buffer size, leading to heap memory corruption. This vulnerability mostly impacts process availability. Maintainers believe exploitation for arbitrary code execution is unlikely. A patch is available and anticipated to be part of yajl-ruby version 1.4.2. As a workaround, avoid passing large inputs to YAJL.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8yajl2.1.0-11.el8ALSA-2022:7524
AlmaLinux:9yajl2.1.0-21.el9ALSA-2022:8252
AlmaLinux:8yajl-devel2.1.0-11.el8ALSA-2022:7524
AlmaLinux:9yajl-devel2.1.0-21.el9ALSA-2022:8252
Debian:12burpno fix listedDEBIAN-CVE-2022-24795
Debian:13burp3.1.4-2DEBIAN-CVE-2022-24795
Debian:12r-cran-jsonliteno fix listedDEBIAN-CVE-2022-24795
Debian:13r-cran-jsonlite1.8.8+dfsg-1DEBIAN-CVE-2022-24795
Debian:14r-cran-jsonlite1.8.8+dfsg-1DEBIAN-CVE-2022-24795
Debian:12ruby-yajl1.4.3-1DEBIAN-CVE-2022-24795
Debian:13ruby-yajl1.4.3-1DEBIAN-CVE-2022-24795
Debian:14ruby-yajl1.4.3-1DEBIAN-CVE-2022-24795
Debian:12yajl2.1.0-3+deb12u2DEBIAN-CVE-2022-24795
Debian:13yajl2.1.0-4DEBIAN-CVE-2022-24795
Debian:14yajl2.1.0-4DEBIAN-CVE-2022-24795
Rocky Linux:8yajl0:2.1.0-11.el8RLSA-2022:7524
Rocky Linux:9yajl0:2.1.0-21.el9_0RLSA-2022:8252
Rocky Linux:9yajl0:2.1.0-21.el9RLSA-2022:8252
RubyGemsyajl-ruby1.4.3GHSA-jj47-x69x-mxrm
Ubuntu:22.04:LTSargyllno fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSargyllno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10argyllno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSargyllno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10argyllno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSburpno fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSburpno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10burpno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSburpno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTScollada2gltfno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSicinga2no fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSicinga2no fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10icinga2no fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSicinga2no fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10icinga2no fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSlnavno fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSlnavno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10lnavno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSlnavno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10lnavno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSphp-mongodbno fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSphp-mongodbno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10php-mongodbno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSphp-mongodbno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10php-mongodbno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSr-cran-jsonliteno fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSr-cran-jsonliteno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10r-cran-jsonliteno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSr-cran-jsonliteno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10r-cran-jsonliteno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSruby-yajlno fix listedUBUNTU-CVE-2022-24795
Ubuntu:24.04:LTSruby-yajlno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10ruby-yajlno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTSruby-yajlno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10ruby-yajlno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTStulipno fix listedUBUNTU-CVE-2022-24795
Ubuntu:25.10tulipno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.04:LTStulipno fix listedUBUNTU-CVE-2022-24795
Ubuntu:26.10tulipno fix listedUBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSyajl2.1.0-3ubuntu0.22.04.1UBUNTU-CVE-2022-24795
Ubuntu:22.04:LTSyajl2.1.0-3ubuntu0.22.04.1USN-6233-2

Affected products (as reported)

VendorProductVersions
brianmario yajl-ruby <= 1.4.1

Weakness: CWE-122, CWE-190 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

References