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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | yajl | 2.1.0-11.el8 | ALSA-2022:7524 |
| AlmaLinux:9 | yajl | 2.1.0-21.el9 | ALSA-2022:8252 |
| AlmaLinux:8 | yajl-devel | 2.1.0-11.el8 | ALSA-2022:7524 |
| AlmaLinux:9 | yajl-devel | 2.1.0-21.el9 | ALSA-2022:8252 |
| Debian:12 | burp | no fix listed | DEBIAN-CVE-2022-24795 |
| Debian:13 | burp | 3.1.4-2 | DEBIAN-CVE-2022-24795 |
| Debian:12 | r-cran-jsonlite | no fix listed | DEBIAN-CVE-2022-24795 |
| Debian:13 | r-cran-jsonlite | 1.8.8+dfsg-1 | DEBIAN-CVE-2022-24795 |
| Debian:14 | r-cran-jsonlite | 1.8.8+dfsg-1 | DEBIAN-CVE-2022-24795 |
| Debian:12 | ruby-yajl | 1.4.3-1 | DEBIAN-CVE-2022-24795 |
| Debian:13 | ruby-yajl | 1.4.3-1 | DEBIAN-CVE-2022-24795 |
| Debian:14 | ruby-yajl | 1.4.3-1 | DEBIAN-CVE-2022-24795 |
| Debian:12 | yajl | 2.1.0-3+deb12u2 | DEBIAN-CVE-2022-24795 |
| Debian:13 | yajl | 2.1.0-4 | DEBIAN-CVE-2022-24795 |
| Debian:14 | yajl | 2.1.0-4 | DEBIAN-CVE-2022-24795 |
| Rocky Linux:8 | yajl | 0:2.1.0-11.el8 | RLSA-2022:7524 |
| Rocky Linux:9 | yajl | 0:2.1.0-21.el9_0 | RLSA-2022:8252 |
| Rocky Linux:9 | yajl | 0:2.1.0-21.el9 | RLSA-2022:8252 |
| RubyGems | yajl-ruby | 1.4.3 | GHSA-jj47-x69x-mxrm |
| Ubuntu:22.04:LTS | argyll | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | argyll | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | argyll | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | argyll | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | argyll | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | burp | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | burp | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | burp | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | burp | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | collada2gltf | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | icinga2 | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | icinga2 | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | icinga2 | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | icinga2 | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | icinga2 | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | lnav | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | lnav | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | lnav | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | lnav | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | lnav | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | php-mongodb | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | php-mongodb | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | php-mongodb | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | php-mongodb | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | php-mongodb | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | r-cran-jsonlite | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | r-cran-jsonlite | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | r-cran-jsonlite | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | r-cran-jsonlite | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | r-cran-jsonlite | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | ruby-yajl | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:24.04:LTS | ruby-yajl | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | ruby-yajl | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | ruby-yajl | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | ruby-yajl | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | tulip | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:25.10 | tulip | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.04:LTS | tulip | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:26.10 | tulip | no fix listed | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | yajl | 2.1.0-3ubuntu0.22.04.1 | UBUNTU-CVE-2022-24795 |
| Ubuntu:22.04:LTS | yajl | 2.1.0-3ubuntu0.22.04.1 | USN-6233-2 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://github.com/brianmario/yajl-ruby/security/advisories/GHSA-jj47-x69x-mxrm
- https://github.com/brianmario/yajl-ruby/commit/7168bd79b888900aa94523301126f968a93eb3a6
- https://github.com/brianmario/yajl-ruby/blob/7168bd79b888900aa94523301126f968a93eb3a6/ext/yajl/yajl_buf.c#L64
- [debian-lts-announce] 20230711 [SECURITY] [DLA 3492-1] yajl security update mailing-list
- FEDORA-2023-00572178e1 vendor-advisory
- FEDORA-2023-852b377773 vendor-advisory
- [debian-lts-announce] 20230805 [SECURITY] [DLA 3516-1] burp security update mailing-list