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

- Priority: **Routine**
- Reason: Not severe (CVSS 5.9, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-04-05 · Modified: 2025-04-22
- Aliases: SUSE-SU-2022:1746-1, SUSE-SU-2022:1918-1, SUSE-SU-2022:3162-1, RHSA-2022:7524, RHSA-2022:8252, UBUNTU-CVE-2022-24795, DEBIAN-CVE-2022-24795, GHSA-jj47-x69x-mxrm, USN-9304-1
- Record: https://cvemate.com/vulnerability/CVE-2022-24795 · JSON: https://cvemate.com/vulnerability/CVE-2022-24795/json

## Description

```text
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.
```

## Signals

- CVSS: 7.5 high (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- EPSS: 3.444%, percentile 89.363%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected (first 20 of 34)

- brianmario yajl-ruby: ≤ 1.4.1
- debian burp (Debian): All versions (No fix recorded) \| \< 3.1.4-2
- debian r-cran-jsonlite (Debian): All versions (No fix recorded) \| \< 1.8.8+dfsg-1
- debian ruby-yajl (Debian): \< 1.4.3-1
- debian yajl (Debian): \< 2.1.0-3+deb12u2 \| \< 2.1.0-4
- ubuntu argyll (Ubuntu): All versions (No fix recorded)
- ubuntu burp (Ubuntu): All versions (No fix recorded) \| \< 2.0.54-4ubuntu0.1~esm1 \| \< 2.2.18-2ubuntu0.1~esm1 \| \< 2.4.0-3ubuntu1+esm1
- ubuntu collada2gltf (Ubuntu): All versions (No fix recorded)
- ubuntu icinga2 (Ubuntu): All versions (No fix recorded)
- ubuntu libbson (Ubuntu): All versions (No fix recorded)
- ubuntu lnav (Ubuntu): All versions (No fix recorded)
- ubuntu php-mongodb (Ubuntu): All versions (No fix recorded)
- ubuntu r-cran-jsonlite (Ubuntu): All versions (No fix recorded)
- ubuntu ruby-yajl (Ubuntu): All versions (No fix recorded) \| \< 1.2.0-3ubuntu0.1~esm1
- ubuntu tulip (Ubuntu): All versions (No fix recorded)
- ubuntu yajl (Ubuntu): \< 2.0.4-4ubuntu0.1~esm1 \| \< 2.1.0-2ubuntu0.16.04.1~esm1 \| \< 2.1.0-2ubuntu0.18.04.1~esm1 \| \< 2.1.0-3ubuntu0.20.04.1 \| \< 2.1.0-3ubuntu0.22.04.1
- RubyGems yajl-ruby (RubyGems): \< 1.4.3
- opensuse libyajl&distro=openSUSE Leap 15.3 (openSUSE): \< 2.1.0-150000.4.3.1
- opensuse libyajl&distro=openSUSE Leap 15.4 (openSUSE): \< 2.1.0-150000.4.3.1
- opensuse libyajl&distro=openSUSE Leap Micro 5.2 (openSUSE): \< 2.1.0-150000.4.3.1

## References (first 20 of 34)

- <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>
- <https://lists.debian.org/debian-lts-announce/2023/07/msg00013.html>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KLE3C4CECEJ4EUYI56KXI6OWACWXX7WN/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YO32YDJ74DADC7CMJNLSLBVWN5EXGF5J/>
- <https://lists.debian.org/debian-lts-announce/2023/08/msg00003.html>
- <https://www.suse.com/support/update/announcement/2022/suse-su-20221746-1/>
- <https://bugzilla.suse.com/1198405>
- <https://www.suse.com/security/cve/CVE-2022-24795>
- <https://www.suse.com/support/update/announcement/2022/suse-su-20221918-1/>
- <https://www.suse.com/support/update/announcement/2022/suse-su-20223162-1/>
- <https://access.redhat.com/errata/RHSA-2022:7524>
- <https://access.redhat.com/security/updates/classification/#moderate>
- <https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/8.7_release_notes/index>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2072912>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2022/rhsa-2022_7524.json>
- <https://access.redhat.com/security/cve/CVE-2022-24795>
- <https://www.cve.org/CVERecord?id=CVE-2022-24795>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-24795>

---

Data as of 2026-12-05T04:55:39.968Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
