CVE-2026-48705: MONAILabel Server Crash and Silent Inference Corruption via Crafted DICOM (pydicom DS/IS Validation Bypass)
A single crafted DICOM file with NaN or infinity in a Decimal String field such as `PixelSpacing` can crash a MONAILabel inference run or silently corrupt its output. MONAI's `PydicomReader` builds its affine matrix from those values without finite checks. The advisory data lists the `monai` package as fixed in 1.6.1.
Published Oct 27, 2026 · Analysis Oct 27, 2026
What an attacker can do
The flaw has three layers. pydicom's DSfloat calls float(), which accepts NaN and inf, and its validity check runs only in RAISE mode, not the default WARN mode. MONAI's PydicomReader._get_affine() builds a 4x4 matrix from PixelSpacing, ImagePositionPatient and ImageOrientationPatient with no isfinite() check. So NaN flows through LoadImaged, Spacingd, the model and the writer. The MONAILabel REST API PUT /datastore/ accepts DICOM uploads, with no authentication in the default deployment.
The reporter uploaded three files of about 132 KB with NaN or inf geometry. Inference on each returned HTTP 500 from an ITK writer error after about 16 to 18 seconds of compute. The bad file stays in the datastore, so every later inference on that image ID fails again, and it survives restarts.
The attacker needs network access to the server, by default port 8000. The impacts are denial of service, repeated cheaply, and silent corruption: when the writer does not fail, the server returns a segmentation with wrong geometry and HTTP 200, with no warning. In a clinical research setting, wrong masks are the worse outcome. The report says other MONAI components that read DICOM, such as MONAI Deploy App SDK, are exposed to the same input.
Who is affected
The pip package monai before 1.6.1 is affected. The report tested MONAI 1.5.2 with pydicom 3.0.2. The MONAILabel server is exposed when its REST API is reachable by untrusted users and the datastore accepts uploads. Library users who read untrusted DICOM through PydicomReader are affected too.
Check the versions:
pip show monai monailabel pydicomFor Docker, check the image tag of projectmonai/monailabel.
monai
- Ecosystem
- PyPI
- Affected
- < 1.6.1
- Fixed in
- 1.6.1
- Check
pip show monai
How to fix it
Upgrade monai to 1.6.1:
pip install --upgrade monai==1.6.1The advisory recommends math.isfinite() checks in PydicomReader._get_affine(), a finite check in LoadImaged and Spacingd, HTTP 400 for invalid geometry on PUT /datastore/, and a pydicom change to reject NaN and inf in all validation modes. It does not state which of these 1.6.1 contains, so read the release notes.
Until then, put authentication in front of the MONAILabel API, do not expose port 8000 to untrusted networks, and remove any DICOM with non-finite geometry from the datastore.
How to tell if you were hit
Check the datastore for DICOM files whose PixelSpacing, ImagePositionPatient or SliceThickness hold nan or inf. Search server logs for HTTP 500 on /infer/ calls with GDCMImageIO: A Floating point buffer was passed in the traceback.
Check access logs for PUT /datastore/ calls from unknown clients, and for repeated inference on one image ID. Review any segmentation produced from files you did not curate.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
An unauthenticated remote attacker can crash a running MONAILabel server or silently corrupt its medical AI inference results by uploading a single crafted DICOM file (~132 KB) via the REST API. The vulnerability stems from pydicom's lack of validation for Decimal String (DS) and Integer String (IS) DICOM Value Representations, which allows NaN and infinity values to pass through MONAI's PydicomReader and propagate through the entire spatial transform and ML inference pipeline.
No authentication is required for the default MONAILabel REST API. The attacker needs only network access to the server (default port 8000).
Severity: CVSS 3.1: 8.7 HIGH CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:L CWE: CWE-20 (Improper Input Validation) → CWE-682 (Incorrect Calculation)
Details
Root Cause — Layer 1: pydicom accepts invalid VR values
pydicom's DSfloat.__new__() calls Python's float(val), which silently accepts "NaN", "inf", and "-inf". The DICOM standard (PS3.5 Table 6.2-1) defines DS as digits 0-9, +, -, ., e only. NaN and inf are not valid DS values. The is_valid_ds() check only runs in RAISE validation mode, which is NOT the default. The default mode is WARN, which still returns the invalid value.
>>> from pydicom.valuerep import DSfloat
>>> DSfloat("NaN")
nan # Accepted silently — should be rejected
>>> DSfloat("inf")
inf # Accepted silently — should be rejectedThis affects ALL pydicom versions from 0.9.7 through 3.0.2 (current).
A related bypass exists in pydicom's IS type: IS("1e4") returns 10000 via an int(float(val)) fallback, accepting scientific notation that is not valid per the DICOM standard.
Root Cause — Layer 2: MONAI Core trusts pydicom output without validation
MONAI's PydicomReader._get_affine() builds a 4x4 affine transformation matrix from PixelSpacing, ImagePositionPatient, and ImageOrientationPatient with ZERO isfinite() or isnan() checks. NaN in PixelSpacing produces NaN in the affine diagonal, propagating through every spatial transform: PydicomReader._get_affine() → LoadImaged → Spacingd → Model → Writer
Root Cause — Layer 3: MONAILabel REST API accepts anything
MONAILabel's PUT /datastore/ endpoint accepts DICOM uploads with no authentication (default deployment), no validation of spatial metadata, and no bounds checking on any DICOM tag values. The malicious DICOM is stored permanently and made available for inference.
PoC
Environment Setup:
# Start MONAILabel (Docker)
docker pull projectmonai/monailabel:latest
docker run -d --name monailabel-poc -p 8000:8000 --memory=8g \
projectmonai/monailabel:latest monailabel start_server \
--app /opt/monai/sample-apps/radiology \
--studies /opt/monai/datasets/Task09_Spleen/imagesTr \
--conf models segmentation
# Verify server is running
curl http://localhost:8000/info/Step 1 — Establish baseline (legitimate data works):
curl -X POST "http://localhost:8000/infer/segmentation?image=spleen_40" \
-o baseline.nii.gz -w "HTTP %{http_code} - %{size_download} bytes"
# Result: HTTP 200, ~223,628 bytes valid segmentation maskStep 2 — Run the attack (NaN DICOM upload + inference):
pip install pydicom numpy requests
python poc_monailabel_ds_bypass.py --server http://localhost:8000The PoC script:
- Confirms pydicom accepts NaN/inf in DS fields
- 2. Creates three malicious DICOM files (~132 KB each) with NaN/inf in PixelSpacing and ImagePositionPatient
- 3. Uploads each via
PUT /datastore/(no auth required) — HTTP 200 accepted - 4. Triggers inference via
POST /infer/segmentation— HTTP 500, server crash
Demonstrated Results:
| Payload | Upload | Inference | Result | | Baseline (spleen_40) | N/A | HTTP 200 | Valid 223 KB segmentation | | NaN PixelSpacing | HTTP 200 | HTTP 500 | RuntimeError crash (18.0s wasted compute) | | NaN PixelSpacing + IPP | HTTP 200 | HTTP 500 | RuntimeError crash (16.7s wasted compute) | | Inf PixelSpacing | HTTP 200 | HTTP 500 | RuntimeError crash (16.4s wasted compute) |
Server crash traceback:
monailabel/tasks/infer/basic_infer.py → self.writer(data)
monailabel/transform/writer.py → write_itk(...)
itk/ITKCommonBasePython.py → itkProcessObject_Update()
RuntimeError: itkGDCMImageIO.cxx:1226:
ITK ERROR: GDCMImageIO: A Floating point buffer was passed
but the stored pixel type was not specified.Each request burns ~16 seconds of server compute (full ML inference pipeline) before crashing. The NaN DICOM persists in the datastore — any future inference on that image ID crashes the server again.
Library-level confirmation: 17/17 test vectors confirmed against MONAI 1.5.2 and pydicom 3.0.2, including actual MONAI LoadImaged and Spacingd transforms accepting NaN geometry without error.
Impact
- Denial of Service: A single ~132 KB DICOM upload crashes the MONAILabel inference pipeline. All active inference requests from legitimate users are aborted. Repeatable indefinitely with minimal bandwidth.
- Silent Data Corruption: NaN values in spatial metadata propagate through the entire ML inference pipeline and produce geometrically incorrect segmentation masks. If the output writer does not crash, the result is returned with HTTP 200 and zero warnings.
- Persistent Datastore Poisoning: The malicious DICOM is stored permanently via
PUT /datastore/. Any future inference request on that image ID reproduces the crash or corruption, persisting across server restarts.
Affected MONAI Ecosystem (9 repositories):
- MONAI Core: PydicomReader, LoadImaged, Spacingd transforms
- - MONAILabel: REST API + DICOMweb datastore
- - MONAI Deploy App SDK: DICOMDataLoaderOperator
- - model-zoo, VISTA, GenerativeModels, tutorials, research-contributions
Affected DICOM Tags (any DS VR): PixelSpacing, ImagePositionPatient, SliceThickness, ImageOrientationPatient, RescaleSlope, WindowCenter/WindowWidth
Recommended Fix:
- Add
math.isfinite()validation inPydicomReader._get_affine()on all values from PixelSpacing, IPP, IOP. Raise ValueError for NaN/inf. - 2. Validate spatial metadata of uploaded DICOM in MONAILabel
PUT /datastore/. Return HTTP 400 for invalid geometry. - 3. Validate spatial metadata is finite in
LoadImaged/Spacingdbefore resampling. - 4. Coordinate with pydicom upstream to reject NaN/inf in DS fields in all validation modes.
Upstream: pydicom GHSA filed 2026-04-05.
Author: Paulino Calderon ([email protected])
Credited to cldrn.
Questions
- Does the MONAILabel attack need authentication?
Not in the default deployment. The advisory says the REST API needs no authentication, and the attacker needs only network access to the server, by default port 8000.
- Can the corrupted result go unnoticed?
Yes. When the output writer does not crash, the server returns a segmentation with wrong geometry and HTTP 200 and no warning, according to the advisory.
- Which version fixes it?
The advisory data lists monai 1.6.1 as patched. The title names MONAILabel, but the affected package is the monai library.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More PyPI vulnerabilities
All PyPI entriesGHSA-qxq5-qhx6-94qw
Incomplete Fix in MONAI: algo_from_pickle() pickle.loads() RCE still present in v1.5.2 despite GHSA-89gg-p5r5-q6r4 claiming patch
high7.8Aug 18, 2026GHSA-wg9g-w2j2-8pgr
MONAI: Unsafe deserialization in NumpyReader allows arbitrary code execution via malicious .npy files
high7.8Aug 18, 2026GHSA-89gg-p5r5-q6r4
MONAI: Unsafe functions lead to pickle deserialization rce
high7.6Apr 7, 2026CVE-2026-21851
MONAI has Path Traversal (Zip Slip) in NGC Private Bundle Download
medium5.3Jan 6, 2026CVE-2025-58755
MONAI does not prevent path traversal, potentially leading to arbitrary file writes
high8.8Sep 9, 2025CVE-2025-58756
MONAI: Unsafe torch usage may lead to arbitrary code execution
high8.8Sep 9, 2025
