/

CVE-2026-118670

Severity:

HIGH RISK

(8.8)

Cross-Site Scripting (CWE-79) in OHIF DICOM-PDF Viewer

CVE-2026-118670

Awaiting Analysis

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Same-origin script execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OHIF's dicom-pdf extension can treat attacker-controlled DICOM document data as HTML when creating a Blob for display. If a victim opens a malicious Encapsulated PDF DICOM object, embedded script may run in the OHIF origin and access same-origin data or make authenticated requests.

Affected context

The issue occurs in OHIF's dicom-pdf extension when it handles Encapsulated PDF SOP Class objects. The extension uses the DICOM MIMETypeOfEncapsulatedDocument value as the Blob media type, then embeds the resulting Blob URL in an object element. Risk depends on an attacker being able to supply or modify a DICOM object that a user later opens, such as through a local file, shared PACS, or DICOMweb source.

Exploit preconditions

  • Attack surface: The OHIF dicom-pdf extension's handling and display of Encapsulated PDF DICOM objects
  • Required access: Ability to provide or influence a DICOM object and its MIME type and encapsulated bytes
  • Trigger point: A victim opens the malicious object in OHIF
  • Why exploitation is possible: The attacker-controlled MIME type can cause the Blob to be interpreted as HTML, and its URL inherits the OHIF origin despite the object element's PDF hint

Why this happens

The application uses an untrusted DICOM metadata value to determine how attacker-controlled document bytes are interpreted by the browser. When those bytes are rendered as active HTML in a Blob URL associated with the application's origin, script can execute with access to that origin's privileges. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, because untrusted content is allowed to become executable page content.

Potential impact

  • Embedded script may access session storage or authentication tokens available to the OHIF origin
  • Script may make authenticated requests to same-origin PACS services
  • A victim's session or accessible imaging data could be exposed or misused
  • The application's integrity could be affected through actions available to the victim's session

General mitigation guidance

Defensive patterns focus on preventing untrusted document data from becoming active content in the application's origin.

  • Use a strict allowlist for accepted document media types and set the type independently of attacker-controlled metadata.
  • Validate that the document content and declared type are consistent before rendering.
  • Prefer a secure, isolated rendering context for documents, with sandboxing and a separate origin where practical.
  • Apply restrictive content security policies and avoid exposing sensitive tokens to browser-accessible storage.
  • Limit PACS and application permissions to the minimum required for the user and viewer workflow.

How teams detect issues like this

  • Use static analysis and code review to find flows where DICOM metadata controls Blob types, document rendering, or embedded object content.
  • Review whether user-controlled document bytes can be rendered as active HTML and whether the rendering context shares the application origin.
  • Add tests and policy checks requiring media types to come from a fixed allowlist and document viewers to use an appropriately isolated context.
  • Monitor for unexpected HTML document rendering in workflows intended for PDF content; automated code review tools may help identify risky data flows.

Sources

SourceLink
github.comgithub.com/OHIF/Viewers/commit/db546701bd5f2be9031c835f1de5c40aacd3dc62
github.comgithub.com/OHIF/Viewers/commit/ef0811c66cdb04ba07ffaba145cf66ce01486899
github.comgithub.com/OHIF/Viewers/commit/f0dba789a313f40fe7e8a8cbec322a8d8a491d76
github.comgithub.com/OHIF/Viewers/pull/6228
github.comgithub.com/OHIF/Viewers/releases/tag/v3.12.15
github.comgithub.com/OHIF/Viewers/releases/tag/v3.13.7
github.comgithub.com/OHIF/Viewers/releases/tag/v3.14.0-beta.19
github.comgithub.com/OHIF/Viewers/security/advisories/GHSA-xwgp-w3pj-q5h3

Frequently asked

questions

The object can be supplied through a shared PACS or DICOMweb source, but exploitation requires a victim to open it in OHIF. A locally supplied DICOM object may also pose a risk.

An attacker needs a way to provide or influence a DICOM object that the victim will view. The description does not indicate that the attacker must already have access to the victim's OHIF session.

Do not let untrusted metadata select an active document media type. Use a fixed, validated type and render documents in a suitably isolated context.

Treat document metadata and bytes as untrusted, constrain accepted formats, test rendering boundaries, and keep sensitive application privileges out of contexts that display external content.

Find out what's already
exploitable in your codebase.