jxl-grid on 32-bit platforms has an out-of-bounds writes due to integer overflow (CVE-2026-52834)
### Summary On 32-bit platforms, decoding a crafted image may lead to out-of-bounds writes due to integer overflow in length calculation. ### Details & PoC The test listed below fail under miri with command `cargo +nightly miri test --release -p jxl-grid` Or you can use Address Sanitizer, which ignores Rust-specific UB like aliasing but still flags out-of-bounds accesses: `RUSTFLAGS=-Zsanitizer=address cargo +nightly test -Zbuild-std -p jxl-grid --release --target x86_64-unknown-linux-gnu` The following tests should be appended to `crates/jxl-grid/src/test/subgrids.rs`: ```rust mod miri_ub { use super::*; // `AlignedGrid::with_alloc_tracker` computes `width * height` unchecked. In release, overflow // can create a tiny backing buffer for huge logical dimensions. #[test] fn aligned_grid_dimension_product_overflows() { let width = usize::MAX / 2 + 1; let mut grid = AlignedGrid::<u8>::with_alloc_tracker(width, 2, None).unwrap(); let mut subgrid = grid.as_subgrid_mut(); *subgrid.get_mut(0, 1) = 1; std::hint::black_box(grid); } } ``` This issue can be reachable through decoding a crafted image in two ways: 1. **Huge actual frame** A frame such as `65536 x 65536` passes the current frame area limit (`2^32 <= 2^40`) but overflows `usize` element count on 32-bit. Rendering then allocates too-small `AlignedGrid`s in modular/VarDCT/filter paths and later writes through mutable subgrids. 2. **Huge canvas plus tiny cropped frame** This is the more practical “small payload, huge logical output” case. A bitstream-controlled frame crop can be tiny, but if the canvas/default requested region is huge, composition can allocate an output grid sized to the canvas/ROI at crates/jxl-render/src/blend.rs. That is bitstream frame cropping, not API crop. With a 32-bit target and a full requested image region whose area overflows, this can happen through ordinary `render_frame()`. ### Impact On 32-bit platforms this can cause out-of-bounds writes with attacker-controlled data when decoding a crafted JPEG XL image. This could allow arbitrary code execution.
AI Analysis
Technical Summary
The jxl-grid crate on 32-bit platforms suffers from an integer overflow vulnerability in the calculation of buffer sizes during image decoding. Specifically, the product of width and height is computed without overflow checks, which on 32-bit systems can wrap around and cause allocation of buffers that are too small. Subsequent writes to these buffers during image rendering can lead to out-of-bounds memory writes. This can be triggered by decoding crafted JPEG XL images with either very large frames or small cropped frames within a large canvas. The vulnerability is tracked as CVE-2026-52834 and affects jxl-grid versions before 0.6.2.
Potential Impact
On affected 32-bit platforms, decoding a maliciously crafted JPEG XL image can cause out-of-bounds memory writes due to integer overflow in buffer size calculations. This memory corruption can lead to arbitrary code execution. The vulnerability impacts confidentiality, integrity, and availability as indicated by the CVSS vector (C:L/I:L/A:H). There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix is available in jxl-grid version 0.6.2 and later. Users should upgrade to version 0.6.2 or newer to remediate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.
jxl-grid on 32-bit platforms has an out-of-bounds writes due to integer overflow (CVE-2026-52834)
Description
### Summary On 32-bit platforms, decoding a crafted image may lead to out-of-bounds writes due to integer overflow in length calculation. ### Details & PoC The test listed below fail under miri with command `cargo +nightly miri test --release -p jxl-grid` Or you can use Address Sanitizer, which ignores Rust-specific UB like aliasing but still flags out-of-bounds accesses: `RUSTFLAGS=-Zsanitizer=address cargo +nightly test -Zbuild-std -p jxl-grid --release --target x86_64-unknown-linux-gnu` The following tests should be appended to `crates/jxl-grid/src/test/subgrids.rs`: ```rust mod miri_ub { use super::*; // `AlignedGrid::with_alloc_tracker` computes `width * height` unchecked. In release, overflow // can create a tiny backing buffer for huge logical dimensions. #[test] fn aligned_grid_dimension_product_overflows() { let width = usize::MAX / 2 + 1; let mut grid = AlignedGrid::<u8>::with_alloc_tracker(width, 2, None).unwrap(); let mut subgrid = grid.as_subgrid_mut(); *subgrid.get_mut(0, 1) = 1; std::hint::black_box(grid); } } ``` This issue can be reachable through decoding a crafted image in two ways: 1. **Huge actual frame** A frame such as `65536 x 65536` passes the current frame area limit (`2^32 <= 2^40`) but overflows `usize` element count on 32-bit. Rendering then allocates too-small `AlignedGrid`s in modular/VarDCT/filter paths and later writes through mutable subgrids. 2. **Huge canvas plus tiny cropped frame** This is the more practical “small payload, huge logical output” case. A bitstream-controlled frame crop can be tiny, but if the canvas/default requested region is huge, composition can allocate an output grid sized to the canvas/ROI at crates/jxl-render/src/blend.rs. That is bitstream frame cropping, not API crop. With a 32-bit target and a full requested image region whose area overflows, this can happen through ordinary `render_frame()`. ### Impact On 32-bit platforms this can cause out-of-bounds writes with attacker-controlled data when decoding a crafted JPEG XL image. This could allow arbitrary code execution.
CVSS v3.1
Score 7.3high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The jxl-grid crate on 32-bit platforms suffers from an integer overflow vulnerability in the calculation of buffer sizes during image decoding. Specifically, the product of width and height is computed without overflow checks, which on 32-bit systems can wrap around and cause allocation of buffers that are too small. Subsequent writes to these buffers during image rendering can lead to out-of-bounds memory writes. This can be triggered by decoding crafted JPEG XL images with either very large frames or small cropped frames within a large canvas. The vulnerability is tracked as CVE-2026-52834 and affects jxl-grid versions before 0.6.2.
Potential Impact
On affected 32-bit platforms, decoding a maliciously crafted JPEG XL image can cause out-of-bounds memory writes due to integer overflow in buffer size calculations. This memory corruption can lead to arbitrary code execution. The vulnerability impacts confidentiality, integrity, and availability as indicated by the CVSS vector (C:L/I:L/A:H). There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix is available in jxl-grid version 0.6.2 and later. Users should upgrade to version 0.6.2 or newer to remediate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-5pmv-rx8r-wmv5
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-52834"]
- Ecosystems
- ["crates.io"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a46ecae27e9c7971943b8e5
Added to database: 07/02/2026, 22:56:46 UTC
Last enriched: 07/02/2026, 23:06:06 UTC
Last updated: 07/31/2026, 12:27:30 UTC
Views: 40
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.