GHSA-XWGP-W3PJ-Q5H3

Vulnerability from github – Published: 2026-11-10 15:57 – Updated: 2026-11-10 15:57
VLAI
Summary
OHIF Viewers: DOM-Based Cross Site Scripting (XSS) through MIME type of document
Details

Summary

An XSS (Cross-Site Scripting) vulnerability occurs when an attacker is able to inject their own JavaScript code into a web page's source, which is subsequently processed by the victim's browser. A common cause of this vulnerability is the failure to validate user-supplied data before displaying it within the vulnerable application without proper filtering. To exploit the vulnerability, an attacker must input HTML code into a vulnerable parameter containing structures that trigger the execution of JavaScript. The DOM XSS variant occurs when user-supplied data is processed by a client-side script; if this data is not handled correctly by the script itself, it becomes possible to inject additional JavaScript commands.

Attacker model: Any actor who can get a DICOM object in front of a victim — email a .dcm for local viewing, upload to a shared PACS, or operate/compromise a DICOMweb source. Preconditions: Victim opens a study whose SOP Class is Encapsulated PDF (1.2.840.10008.5.1.4.1.1.104.1) and OHIF's dicom-pdf extension renders it (default in the standard modes).

Taint path

Source — two attacker-controlled tags on the encapsulated-document instance: - MIMETypeOfEncapsulatedDocument (0042,0012) - EncapsulatedDocument (0042,0011) — the raw document bytes

extensions/dicom-pdf/src/getSopClassHandlerModule.js:15,20 reads the MIME tag with no validation and passes it as defaultType:

const { SeriesDescription = 'PDF', MIMETypeOfEncapsulatedDocument } = instance;
...
const renderedUrlParams = {
  instance,
  tag: 'EncapsulatedDocument',
  defaultType: MIMETypeOfEncapsulatedDocument || 'application/pdf',  // attacker-controlled
  singlepart: 'pdf',
};
const renderedUrl = dataSource.retrieve.directURL(renderedUrlParams);

Sink — defaultType becomes the Blob type in all three retrieval paths:

Local file (no server required): extensions/default/src/DicomLocalDataSource/index.js:120-131

directURL: params => {
  const { instance, tag, defaultType } = params;
  const value = instance[tag];
  if (value instanceof Array && value[0] instanceof ArrayBuffer) {
    return URL.createObjectURL(new Blob([value[0]], { type: defaultType }));  // attacker MIME
  }
},

DICOMweb InlineBinary: extensions/default/src/utils/getDirectURL.ts:40-44 → platform/core/src/utils/b64toBlob.js:18

if (value.InlineBinary) {
  const blob = utils.b64toBlob(value.InlineBinary, defaultType);   // -> new Blob(..., { type: defaultType })
  value.DirectRetrieveURL = URL.createObjectURL(blob);
  return value.DirectRetrieveURL;
}

DICOMweb bulk data: extensions/default/src/utils/getDirectURL.ts:52-55

return value.retrieveBulkData(options).then(arr => {
  value.DirectRetrieveURL = URL.createObjectURL(new Blob([arr], { type: defaultType }));
  return value.DirectRetrieveURL;
});

Render — extensions/dicom-pdf/src/viewports/OHIFCornerstonePdfViewport.tsx:86-92

<object
  data={url}                 {/* blob: URL whose stored MIME = attacker's MIMETypeOfEncapsulatedDocument */}
  type="application/pdf"     {/* only a hint; overridden by the blob's own Content-Type */}
  className={style}
>

Why it fires. A blob: URL stores the MIME type passed at new Blob(..., { type }) construction. When such a URL is navigated/embedded, the browser uses the blob's stored Content-Type to choose a handler; the <object type="application/pdf"> attribute is a pre-load hint, not an override. A blob created with type: 'text/html' therefore renders as an HTML document, and because blob: URLs inherit the creating page's origin, any <script> in it executes in the OHIF origin — with access to localStorage/sessionStorage, auth tokens, and same-origin requests to the PACS.

Impact

Users using the applications. If the application is behind authentication then session can be stolen. If on the same DNS name some other applications are hosted, they are also impacted.

Patches

Fixed in @ohif/extension-dicom-pdf 3.12.18, 3.13.10 and 3.14.0-beta.36 (fix: https://github.com/OHIF/Viewers/pull/6228). If you build OHIF from source, the fix first landed in tags 3.12.15, 3.13.7 and 3.14.0-beta.19. Versions 3.5 to 3.11 will not receive a fix. Upgrade to a patched 3.12, 3.13 or 3.14 version.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@ohif/extension-dicom-pdf"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.5.0-beta.0"
            },
            {
              "fixed": "3.12.18"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@ohif/extension-dicom-pdf"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.13.0-beta.0"
            },
            {
              "fixed": "3.13.10"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@ohif/extension-dicom-pdf"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.14.0-beta.0"
            },
            {
              "fixed": "3.14.0-beta.36"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-118670"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-10T15:57:51Z",
    "nvd_published_at": "2026-11-06T18:17:57Z",
    "severity": "HIGH"
  },
  "details": "### Summary\nAn XSS (Cross-Site Scripting) vulnerability occurs when an attacker is able to inject their own JavaScript code into a web page\u0027s source, which is subsequently processed by the victim\u0027s browser. A common cause of this vulnerability is the failure to validate user-supplied data before displaying it within the vulnerable application without proper filtering. To exploit the vulnerability, an attacker must input HTML code into a vulnerable parameter containing structures that trigger the execution of JavaScript. The DOM XSS variant occurs when user-supplied data is processed by a client-side script; if this data is not handled correctly by the script itself, it becomes possible to inject additional JavaScript commands.\n\n**Attacker model:** Any actor who can get a DICOM object in front of a victim \u2014 email a `.dcm`\nfor local viewing, upload to a shared PACS, or operate/compromise a DICOMweb source.\n**Preconditions:** Victim opens a study whose SOP Class is Encapsulated PDF\n(`1.2.840.10008.5.1.4.1.1.104.1`) and OHIF\u0027s `dicom-pdf` extension renders it (default in the\nstandard modes).\n\n#### Taint path\n\n**Source** \u2014 two attacker-controlled tags on the encapsulated-document instance:\n- `MIMETypeOfEncapsulatedDocument` (0042,0012)\n- `EncapsulatedDocument` (0042,0011) \u2014 the raw document bytes\n\n`extensions/dicom-pdf/src/getSopClassHandlerModule.js:15,20` reads the MIME tag with no\nvalidation and passes it as `defaultType`:\n\n```js\nconst { SeriesDescription = \u0027PDF\u0027, MIMETypeOfEncapsulatedDocument } = instance;\n...\nconst renderedUrlParams = {\n  instance,\n  tag: \u0027EncapsulatedDocument\u0027,\n  defaultType: MIMETypeOfEncapsulatedDocument || \u0027application/pdf\u0027,  // attacker-controlled\n  singlepart: \u0027pdf\u0027,\n};\nconst renderedUrl = dataSource.retrieve.directURL(renderedUrlParams);\n```\n\n**Sink** \u2014 `defaultType` becomes the `Blob` type in all three retrieval paths:\n\n*Local file (no server required):* `extensions/default/src/DicomLocalDataSource/index.js:120-131`\n```js\ndirectURL: params =\u003e {\n  const { instance, tag, defaultType } = params;\n  const value = instance[tag];\n  if (value instanceof Array \u0026\u0026 value[0] instanceof ArrayBuffer) {\n    return URL.createObjectURL(new Blob([value[0]], { type: defaultType }));  // attacker MIME\n  }\n},\n```\n\n*DICOMweb InlineBinary:* `extensions/default/src/utils/getDirectURL.ts:40-44` \u2192\n`platform/core/src/utils/b64toBlob.js:18`\n```js\nif (value.InlineBinary) {\n  const blob = utils.b64toBlob(value.InlineBinary, defaultType);   // -\u003e new Blob(..., { type: defaultType })\n  value.DirectRetrieveURL = URL.createObjectURL(blob);\n  return value.DirectRetrieveURL;\n}\n```\n\n*DICOMweb bulk data:* `extensions/default/src/utils/getDirectURL.ts:52-55`\n```js\nreturn value.retrieveBulkData(options).then(arr =\u003e {\n  value.DirectRetrieveURL = URL.createObjectURL(new Blob([arr], { type: defaultType }));\n  return value.DirectRetrieveURL;\n});\n```\n\n**Render** \u2014 `extensions/dicom-pdf/src/viewports/OHIFCornerstonePdfViewport.tsx:86-92`\n```tsx\n\u003cobject\n  data={url}                 {/* blob: URL whose stored MIME = attacker\u0027s MIMETypeOfEncapsulatedDocument */}\n  type=\"application/pdf\"     {/* only a hint; overridden by the blob\u0027s own Content-Type */}\n  className={style}\n\u003e\n```\n\n**Why it fires.** A `blob:` URL stores the MIME type passed at `new Blob(..., { type })`\nconstruction. When such a URL is navigated/embedded, the browser uses the blob\u0027s stored\nContent-Type to choose a handler; the `\u003cobject type=\"application/pdf\"\u003e` attribute is a\npre-load hint, not an override. A blob created with `type: \u0027text/html\u0027` therefore renders as an\nHTML document, and because `blob:` URLs inherit the creating page\u0027s origin, any `\u003cscript\u003e` in it\nexecutes **in the OHIF origin** \u2014 with access to `localStorage`/`sessionStorage`, auth tokens,\nand same-origin requests to the PACS.\n\n### Impact\nUsers using the applications. If the application is behind authentication then session can be stolen. If on the same DNS name some other applications are hosted, they are also impacted.\n\n### Patches\n\nFixed in `@ohif/extension-dicom-pdf` `3.12.18`, `3.13.10` and `3.14.0-beta.36` (fix: https://github.com/OHIF/Viewers/pull/6228).\nIf you build OHIF from source, the fix first landed in tags `3.12.15`, `3.13.7` and `3.14.0-beta.19`.\nVersions `3.5` to `3.11` will not receive a fix. Upgrade to a patched `3.12`, `3.13` or `3.14` version.",
  "id": "GHSA-xwgp-w3pj-q5h3",
  "modified": "2026-11-10T15:57:51Z",
  "published": "2026-11-10T15:57:51Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/security/advisories/GHSA-xwgp-w3pj-q5h3"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118670"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/pull/6228"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/commit/db546701bd5f2be9031c835f1de5c40aacd3dc62"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/commit/ef0811c66cdb04ba07ffaba145cf66ce01486899"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/commit/f0dba789a313f40fe7e8a8cbec322a8d8a491d76"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/OHIF/Viewers"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/releases/tag/v3.12.15"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/releases/tag/v3.13.7"
    },
    {
      "type": "WEB",
      "url": "https://github.com/OHIF/Viewers/releases/tag/v3.14.0-beta.19"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "OHIF Viewers: DOM-Based Cross Site Scripting (XSS) through MIME type of document"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.