Skip to main content
Vulnerability Database/CVE-2026-111275

CVE-2026-111275: nifti_clib Buffer Overflow Vulnerability

CVE-2026-111275 is a stack-based buffer overflow in nifti_clib through 3.0.1 that allows attackers to crash applications or corrupt memory via crafted NIfTI-2 headers. This post covers technical details, affected versions, impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111275 Overview

CVE-2026-111275 is a stack-based out-of-bounds read and write vulnerability in nifti_clib through version 3.0.1. The flaw resides in the nifti_convert_n2hdr2nim() function within the NIfTI-2 image parsing path. The library never range-checks the dim[0] field of a NIfTI-2 header, which specifies the number of dimensions in the image. A crafted 540-byte NIfTI-2 header processed through nifti_image_read() triggers out-of-bounds access on the stack. The issue is tracked under [CWE-787] (Out-of-bounds Write) and affects applications in the medical imaging ecosystem that link against nifti_clib.

Critical Impact

Attackers who can supply a malicious NIfTI-2 file to a vulnerable application crash the process or corrupt stack memory, with potential for further exploitation.

Affected Products

  • nifti_clib versions through 3.0.1
  • NIfTI-2 image parsing path (nifti2/nifti2_io.c)
  • Downstream medical imaging tools linking against vulnerable nifti_clib builds

Discovery Timeline

  • 2026-10-15 - CVE-2026-111275 published to NVD
  • 2026-10-21 - Last updated in NVD database

Technical Details for CVE-2026-111275

Vulnerability Analysis

The nifti_clib library parses NIfTI-2 headers that describe multi-dimensional medical imaging data. The header carries a dim[] array where dim[0] declares how many dimensions follow. The library trusts this attacker-controlled value without validating it against the fixed stack buffer size used downstream. When nifti_image_read() ingests a 540-byte NIfTI-2 header and dispatches to nifti_convert_n2hdr2nim(), loops iterate up to the attacker-supplied dim[0]. This drives both read and write access beyond the bounds of a stack-allocated structure. The result is memory corruption on the stack frame of the parsing routine.

Root Cause

The root cause is missing input validation on the dim[0] field in the NIfTI-2 header. The NIfTI specification constrains dim[0] to the range 1 through 7. The library accepts any value a crafted file provides, including large or negative values after signed conversion. Loop bounds derived from dim[0] then exceed the fixed-size arrays in the nifti_image structure, producing out-of-bounds reads and writes on the stack. The affected code segment is referenced in the NIFTI2 IO Code Segment.

Attack Vector

Exploitation requires local file access and user interaction. An attacker crafts a malicious 540-byte NIfTI-2 header with an abusive dim[0] value and places the file where a vulnerable application reads it. When a user or automated pipeline opens the file through nifti_image_read(), parsing corrupts the stack. The immediate effect is a crash. Stack corruption primitives may also allow influence over control data such as saved return addresses, depending on compiler mitigations and the linking application. Full technical analysis is documented in the VulnCheck NIFTI Clib Advisory and the HackMD CVE-2026-111275 Analysis.

No verified proof-of-concept code is published. The vulnerability mechanism is described in prose above; refer to the external references for technical reproduction details.

Detection Methods for CVE-2026-111275

Indicators of Compromise

  • Unexpected crashes or SIGSEGV in processes that invoke nifti_image_read() or load .nii and .nii.gz NIfTI-2 files.
  • NIfTI-2 files whose header dim[0] value falls outside the valid range of 1 through 7.
  • Core dumps referencing nifti_convert_n2hdr2nim in the faulting call stack.

Detection Strategies

  • Scan file ingestion directories for NIfTI-2 headers and validate dim[0] before passing files to downstream tools.
  • Deploy fuzzing and AddressSanitizer builds of consumer applications in test environments to surface stack corruption early.
  • Inventory binaries that statically or dynamically link nifti_clib versions through 3.0.1 using software composition analysis.

Monitoring Recommendations

  • Monitor endpoints and workstations used by radiology, research, and medical imaging teams for repeated process crashes tied to NIfTI parsing.
  • Alert on new or unexpected .nii or .nii.gz files arriving from external sources, email attachments, or shared network paths.
  • Correlate crash telemetry with file provenance to identify delivery vectors for malicious NIfTI-2 inputs.

How to Mitigate CVE-2026-111275

Immediate Actions Required

  • Update nifti_clib to a fixed version once a release incorporating Pull Request #197 is published.
  • Audit internal applications and pipelines that bundle nifti_clib and schedule rebuilds against the patched library.
  • Restrict ingestion of NIfTI-2 files to trusted sources until patched builds are deployed.

Patch Information

The upstream fix is tracked in Pull Request #197 and Issue #195 in the NIFTI Clib Repository. The fix adds range validation on the NIfTI-2 dim[0] field before it drives downstream loop bounds in nifti_convert_n2hdr2nim().

Workarounds

  • Pre-validate NIfTI-2 headers at the application boundary and reject files where dim[0] is not between 1 and 7.
  • Process untrusted NIfTI-2 files inside sandboxed or containerized workers with no access to sensitive data or network resources.
  • Compile consumer applications with stack protector, Address Space Layout Randomization (ASLR), and position-independent executables to raise the cost of stack corruption exploitation.
bash
# Example header validation at the ingestion boundary
# Reject NIfTI-2 files whose dim[0] field falls outside the valid range 1..7
# dim[0] for NIfTI-2 is a signed 64-bit integer at header offset 16
validate_nifti2() {
  local file="$1"
  local dim0
  dim0=$(dd if="$file" bs=1 count=8 skip=16 2>/dev/null \
         | od -An -t d8 | tr -d ' ')
  if [ "$dim0" -lt 1 ] || [ "$dim0" -gt 7 ]; then
    echo "REJECT: $file has invalid dim[0]=$dim0"
    return 1
  fi
  return 0
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.