Buffer Overflow and Integer Overflow in yajl-ruby
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 6 fixed, 5 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-122 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| brianmario | yajl-ruby | up to 1.4.1 | — | No fix listed | CNA |
| — | yajl-ruby (RubyGems) | before 1.4.3 | 1.4.3 | Patch available | GHSA-jj47-x69x-mxrm |
- yajl-ruby Vendorbrianmario Affected up to 1.4.1 Fixed in — No fix listed CNA
- yajl-ruby (RubyGems) Vendor— Affected before 1.4.3 Fixed in 1.4.3 Patch available GHSA-jj47-x69x-mxrm
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:yajl-ruby_project:yajl-ruby:*:*:*:*:*:ruby:*:* | before 1.4.2 | Vulnerable | Yajl-ruby Project |
- cpe:2.3:a:yajl-ruby_project:yajl-ruby:*:*:*:*:*:ruby:*:* Versions before 1.4.2 Vulnerable ·Yajl-ruby Project
Remediation
- Fix · GHSA-jj47-x69x-mxrm yajl-ruby (RubyGems) Fixed in 1.4.3 Advisory →
Red Hat 3 advisories
- RHSA-2024:2063 Released 2024-04-25 · Red Hat rating Moderateyajl security update
- Red Hat CodeReady Linux Builder EUS (v.8.6) yajl-devel-2.1.0-13.el8_6
- Red Hat Enterprise Linux AppStream EUS (v.8.6) yajl-2.1.0-13.el8_6
- RHSA-2022:8252 Released 2022-11-15 · Red Hat rating Moderateyajl security update
- Red Hat CodeReady Linux Builder (v. 9) yajl-devel-2.1.0-21.el9
- Red Hat Enterprise Linux AppStream (v. 9) yajl-2.1.0-21.el9
- RHSA-2022:7524 Released 2022-11-08 · Red Hat rating Moderateyajl security update
- Red Hat CodeReady Linux Builder (v. 8) yajl-devel-2.1.0-11.el8
- Red Hat Enterprise Linux AppStream (v. 8) yajl-2.1.0-11.el8
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 8 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 9 | Affected | No fix yet |
| Red Hat OpenShift Container Platform 3.11 | Affected | No fix planned: Out of support scope |
| Red Hat CodeReady Linux Builder (v. 8) | Fixed | RHSA-2022:7524 |
| Red Hat CodeReady Linux Builder (v. 9) | Fixed | RHSA-2022:8252 |
| Red Hat CodeReady Linux Builder EUS (v.8.6) | Fixed | RHSA-2024:2063 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2022:7524 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2022:8252 |
| Red Hat Enterprise Linux AppStream EUS (v.8.6) | Fixed | RHSA-2024:2063 |
Timeline
- 2026-10-02 Threatist record created from CVE-2022-24795
- 2026-10-03 Alias added: GHSA-jj47-x69x-mxrm
References
Exploit 2
Advisory 3
Other 6
- [debian-lts-announce] 20230711 [SECURITY] [DLA 3492-1] yajl security update
- [debian-lts-announce] 20230805 [SECURITY] [DLA 3516-1] burp security update
- https://github.com/brianmario/yajl-ruby
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/yajl-ruby/CVE-2022-24795.yml
- https://lists.fedoraproject.org/archives/list/[email protected]/message/KLE3C4CECEJ4EUYI56KXI6OWACWXX7WN
- https://lists.fedoraproject.org/archives/list/[email protected]/message/YO32YDJ74DADC7CMJNLSLBVWN5EXGF5J
More Yajl-ruby Project Yajl-ruby vulnerabilities
- TI-2017-12131 In the yajl-ruby gem 1.3.0 for Ruby, when a crafted JSON file is supplied to… CVSS 3.1HIGH 7.5
Sources
- CVE-2022-24795 · CVE Program
- CVE-2022-24795 · NVD
- FIRST EPSS
- GHSA-jj47-x69x-mxrm · GitHub Advisory Database · CC BY 4.0
- CVE-2022-24795 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences