Skip to content
File upload Write-up Intermediate

CVE-2023-33466 - Exploiting Healthcare Servers with Polyglot Files

Orthanc before 1.12.0 has an endpoint that allows authenticated users to overwrite arbitrary files, and by overwriting the configuration file with a DICOM polyglot, an attacker can enable Lua execution and achieve remote code execution.

TheZero Follow

Published on shielder.com

Orthanc is an open source software to manage, exchange and visualize medical imaging data. In versions < 1.12.0, it is affected by an arbitrary file overwrite vulnerability (CVE-2023-33466) that might allow an authenticated attacker to obtain RCE on the system.

TheZero (@Th3Zer0), suidpit (@suidpit), on shielder.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application exposes an API endpoint that writes user-supplied DICOM files to arbitrary filesystem paths without restricting the target path, and the configuration file can be overwritten to enable dangerous features.

Impact

An authenticated attacker might overwrite the configuration file and enable Lua execution, potentially leading to remote code execution on the server.

What the attacker needed

Valid credentials (default orthanc:orthanc); knowledge of configuration file path; ability to upload DICOM files

The fix

The vulnerability was fixed in Orthanc 1.12.0 by disabling the file export endpoint by default and introducing a configuration option to enable it.

How it was found

  1. Create a DICOM file that is also a valid Orthanc JSON configuration by replacing the first bytes with a JSON payload and appending a null byte.
  2. Call GET /instances to list currently uploaded instances.
  3. Upload the crafted file through the UI upload functionality.
  4. Call GET /instances again and compare to find the new instance ID.
  5. Call POST /instances/{instance_id}/export with the target configuration path in the POST body.
  6. Trigger a restart via POST /tools/reset.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Orthanc is a server for medical images. A logged-in user could abuse a feature that writes files to the server's disk to replace a configuration file with a specially crafted image that also works as a configuration. This let the attacker turn on a scripting feature and run commands on the server.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by TheZero

View all

2 more disclosed reports, best first.

More from Asus

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.