CVE-2022-24795: brianmario yajl-ruby Heap-based Buffer Overflow
Vulnerability summary
CVE-2022-24795 is a high (CVSS 7.5) Heap-based Buffer Overflow vulnerability in brianmario yajl-ruby. EPSS estimates a 3.47% chance of exploitation in the next 30 days, higher than 88.9% of scored vulnerabilities. 1 public exploit is recorded.
Advisory lineage
Upstream 0 · Downstream 5 · Related 2Timeline
- 05-04-2022PublishedVulnerability first disclosed.
- 22-04-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
7 scores · 6 sources · 2 versions- CVE.orgCNA5.9MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HDiffers
- OSV · Red hatEcosystem advisory · calculated5.9MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · DebianEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · RubygemsEcosystem advisory · calculated5.9MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HDiffers
EPSS trend
Probability
3.47%
Chance of exploitation in the next 30 days
Percentile
89%
Versus all other CVEs
30-day change
0.00 pp
From 3.47% on 19-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundYajl Ruby
Maturity: poc
Weaknesses
CWE · root cause- CWE-122Heap-based Buffer OverflowA heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
- CWE-190Integer Overflow or WraparoundThe product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
Affected systems
Ubuntu11 products
- argyllAll versions (No fix recorded)
- burpAll versions (No fix recorded)
- collada2gltfAll versions (No fix recorded)
- icinga2All versions (No fix recorded)
- libbsonAll versions (No fix recorded)
Suse9 products
- libyajl&distro=SUSE Linux Enterprise Micro 5.1< 2.1.0-150000.4.3.1
- libyajl&distro=SUSE Linux Enterprise Micro 5.2< 2.1.0-150000.4.3.1
- libyajl&distro=SUSE Linux Enterprise Module for Basesystem 15 SP3< 2.1.0-150000.4.3.1
- libyajl&distro=SUSE Linux Enterprise Module for Basesystem 15 SP4< 2.1.0-150000.4.3.1
- libyajl&distro=SUSE Linux Enterprise Server 12 SP5< 2.0.1-18.7.1
Debian4 products
- burpAll versions (No fix recorded) | < 3.1.4-2
- r-cran-jsonliteAll versions (No fix recorded) | < 1.8.8+dfsg-1
- ruby-yajl< 1.4.3-1
- yajl< 2.1.0-3+deb12u2 | < 2.1.0-4
Redhat4 products
- yajl< 0:2.1.0-11.el8 | < 0:2.1.0-21.el9
- yajl-debuginfo< 0:2.1.0-11.el8 | < 0:2.1.0-21.el9
- yajl-debugsource< 0:2.1.0-11.el8 | < 0:2.1.0-21.el9
- yajl-devel< 0:2.1.0-11.el8 | < 0:2.1.0-21.el9
Opensuse3 products
- libyajl&distro=openSUSE Leap 15.3< 2.1.0-150000.4.3.1
- libyajl&distro=openSUSE Leap 15.4< 2.1.0-150000.4.3.1
- libyajl&distro=openSUSE Leap Micro 5.2< 2.1.0-150000.4.3.1
Brianmario1 product
- yajl-ruby≤ 1.4.1
RubyGems1 product
- yajl-ruby< 1.4.3
Yajl-ruby_project1 product
- yajl-ruby< 1.4.2
8 vendors · 34 products
References
32 links- github.com/brianmario/yajl-ruby/security/advisories/GHSA-jj47-x69x-mxrmREPORTWEBExploitThird Party Advisory
- github.com/brianmario/yajl-ruby/commit/7168bd79b888900aa94523301126f968a93eb3a6WEBPatchThird Party Advisory
- github.com/brianmario/yajl-ruby/blob/7168bd79b888900aa94523301126f968a93eb3a6/ext/yajl/yajl_buf.cWEBExploitThird Party Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory