Skip to content

MONAI Label 0.8.8

Latest

Choose a tag to compare

@SachidanandAlle SachidanandAlle released this 25 Nov 09:04

This is a security release. All MONAI Label server deployments should upgrade, and users of the Python client and the 3D Slicer plugin should update too.

pip install -U monailabel==0.8.8
docker pull projectmonai/monailabel:0.8.8

Security

  • Remote code execution through request values in bundle inference and training (GHSA-gfjg-c3x6-24gw, critical). Values from the request were copied into the MONAI bundle configuration, where a string starting with $ is evaluated as Python. Request values are now treated as plain data. Affects 0.7.0 to 0.8.7. Thanks to @Echidna-RyoSakura for the report.
  • Further issues found in a maintainer review of how request values and backend responses are used (GHSA-xhxp-5f3g-gxxx, critical). Affects all versions up to 0.8.7:
    • Bundle training: a tracking value other than mlflow was loaded as a configuration file; request values were placed on the multi-GPU command line; box values from uploaded label files reached the bundle configuration (detection bundles).
    • Scribbles (GMM): num_mixtures reached the compiler command line of MONAI's GMM extension.
    • DSA datastore: an unknown image id was used as a local file path, and ids were placed in the Girder REST path sent with the server's token.
    • Image files whose header names another file as the pixel data (NRRD data file, MetaImage ElementDataFile, HDF5) are rejected.
    • /proxy/dicom: ../ in the path is rejected; only Content-Type and Accept are forwarded from the client.
    • POST /reload requires the admin role (it had no role check).
    • Names, paths and URLs reported by DICOMweb, DSA, XNAT and CVAT servers are confined before they are used; the XNAT project allow-list also applies to label upload and image info.
    • Python client, 3D Slicer, CellProfiler and DSA CLI: the file name of a result sent by the server is no longer used as a local path.

Authentication is disabled by default (MONAI_LABEL_AUTH_ENABLE=False), so these issues are reachable by any client that can connect to the server. Regardless of version:

  • Do not expose the MONAI Label server to untrusted networks.
  • Enable authentication and grant roles only to trusted users.
  • Run the server as an unprivileged user whose write access is limited to the datastore.

Changed

  • Training: tracking accepts mlflow only; any other value means no tracking.
  • PUT /datastore/image: the image id must be a plain, visible file name and the file must have an image extension (the configured datastore extensions, or .nii.gz, .nii, .nrrd, .mha, .dcm, .jpg, .jpeg, .png, .bmp, .tif, .tiff, .svs, .ndpi, .npy).
  • With authentication enabled: saving an inference result as a label (save_label in an /infer request) and POST through /proxy/dicom require the annotator role, like PUT /datastore/label. Access tokens must have an expiry; the realm key is re-fetched hourly.
  • result_extension must be a file extension and result_dtype a numeric dtype; scribbles num_mixtures and num_bins must be whole numbers.
  • Invalid request values are answered with HTTP 400 on /infer.
  • Session ids are random (uuid4).
  • Docker image: FastAPI 0.165.0 with Starlette 1.10 (Starlette 0.37.2 has known advisories). The pip package requires starlette>=1.3.1.

Fixed

  • A CORS allow-list (MONAI_LABEL_CORS_ORIGINS) never matched because of a trailing slash.
  • Image or label info that could not be parsed again could leave the datastore file unreadable.
  • The archive created by GET /datastore/dataset is removed after it has been sent.
  • The TLS key passphrase is no longer written to the log at startup.

Full Changelog: 0.8.7...0.8.8