Out-of-bounds writes due to integer overflow in jxl-grid on 32-bit platforms
On 32-bit platforms, decoding a crafted image may lead to out-of-bounds writes due to integer overflow in length calculation. This could allow arbitrary code execution. ### 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::::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 “sm
- Products
- jxl-grid
- Affected versions
- Not specified
- Fixed versions
- 0.6.2
- CVEs
- CVE-2026-52834
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:44 UTC · Revision 1
Source evidence
Out-of-bounds writes due to integer overflow in jxl-grid on 32-bit platforms
core-osv · Original sourcePublished 29 May 2026, 12:00 UTC
On 32-bit platforms, decoding a crafted image may lead to out-of-bounds writes due to integer overflow in length calculation. This could allow arbitrary code execution. ### 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::::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 “sm
osv:RUSTSEC-2026-0151
jxl-grid
Fixed versions: 0.6.2
Complete source record
{
"id": "b65df30f5e9bac50e91aa56af4c4b314feca3b7b473b3928bcc1f2af10b7bd67",
"url": "https://osv.dev/vulnerability/RUSTSEC-2026-0151",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Out-of-bounds writes due to integer overflow in jxl-grid on 32-bit platforms",
"summary": "On 32-bit platforms, decoding a crafted image may lead to out-of-bounds writes due to integer overflow in length calculation. This could allow arbitrary code execution. ### 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::::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 “sm",
"evidence": "osv:RUSTSEC-2026-0151",
"products": [
{
"name": {
"value": "jxl-grid",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.6.2",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "RUSTSEC-2026-0151",
"aliases": [
"CVE-2026-52834",
"GHSA-5pmv-rx8r-wmv5",
"RUSTSEC-2026-0151"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.6.2"
}
]
}
],
"package": {
"name": "jxl-grid",
"purl": "pkg:cargo/jxl-grid",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": null,
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0151.json",
"categories": [
"memory-corruption"
],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:13.554286599Z",
"provider": "osv",
"references": [
"https://crates.io/crates/jxl-grid",
"https://rustsec.org/advisories/RUSTSEC-2026-0151.html",
"https://github.com/tirr-c/jxl-oxide/commit/3986dadd3926a95656a642e74a0702d52f5c92e2"
],
"provider_metadata": {
"license": "CC0-1.0"
}
},
"related_cves": [
{
"value": "CVE-2026-52834",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 306444,
"published_at": "2026-05-29T12:00:00+00:00"
}