Description
nifti_clib through 3.0.1 contains a stack-based out-of-bounds read and write vulnerability in nifti_convert_n2hdr2nim() because the NIfTI-2 dim[0] value is never range-checked. Attackers can supply a crafted 540-byte NIfTI-2 header read via nifti_image_read() to crash applications or corrupt stack memory.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| NIFTI-Imaging | nifti_clib | ≤ 3.0.1 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | nifticlib | No fix yet | — |
| Ubuntu 26.04 LTS | nifticlib | No fix yet | — |
| Ubuntu 24.04 LTS | nifticlib | No fix yet | — |
| Ubuntu 22.04 LTS | nifticlib | No fix yet | — |
| Ubuntu 20.04 LTS | nifticlib | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | nifticlib | No fix yet | — |
| Ubuntu 16.04 LTS | nifticlib | No fix yet | — |
References
- https://hackmd.io/@haind-pwn/nifticlib-nifti2-dim0-oob technical-description
- https://github.com/NIFTI-Imaging/nifti_clib/issues/195 issue-tracking
- https://github.com/NIFTI-Imaging/nifti_clib/pull/197 issue-tracking patch
- https://github.com/NIFTI-Imaging/nifti_clib/blob/96b9954fafcf3bd69a4ee2091b0d707ed2077697/nifti2/nifti2_io.c#L4985-L5026 technical-description
- https://github.com/NIFTI-Imaging/nifti_clib product
- VulnCheck Advisory: nifti_clib through 3.0.1 Stack Out-of-Bounds Access via nifti_convert_n2hdr2nim third-party-advisory