Vulnerabilities in pkg:npm/msdoc-viewer

PACKAGE
Advisory Identifier: GHSA-3753-m2x2-q623
Advisory Summary

CVE-2026-91127 is a HIGH (CVSS 8.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting File Viewer libraries in the npm ecosystem. The issue involves dom xss via unsafe hyperlink schemes in the legacy doc renderer. Remediation is available by upgrading affected packages to version 0.2.2, 2.3.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/msdoc-viewer

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/msdoc-viewer. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3753-m2x2-q623 CVE-2026-91127 HIGH File Viewer: DOM XSS via unsafe hyperlink schemes in the legacy DOC renderer

CVE-2026-91127 at a Glance

CVE Identifier CVE-2026-91127
GHSA Identifier GHSA-3753-m2x2-q623
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product File Viewer
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-91127

To remediate this vulnerability, upgrade all affected File Viewer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

msdoc-viewer fixed: 0.2.2
npm install msdoc-viewer@0.2.2
@file-viewer/doc fixed: 2.3.1
npm install @file-viewer/doc@2.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls msdoc-viewer

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-91127, inspect your project dependencies using npm:

npm ls msdoc-viewer

Analyze the terminal output to locate any version of File Viewer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.2), your application is affected.

Note: The npm ls msdoc-viewer command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In File Viewer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Before 2.3.1, the legacy `.doc` renderer emitted document hyperlink targets after HTML escaping but without a URL-scheme allowlist. A crafted `.doc` could therefore render a live `javascript:`, `vbscript:`, `data:`, or similarly unsafe link. Script could execute in the embedding origin if a viewer clicked it. ### Impact Applications rendering untrusted legacy `.doc` files with `@file-viewer/doc` or the `msdoc-viewer` compatibility package could expose their origin to attacker-controlled script after link interaction. ### Fix Version 2.3.1 centralizes link handling, removes control-character and scheme confusion, blocks external document links by default, and in explicit allow mode accepts only HTTP(S), mail, telephone, safe relative URLs, and internal bookmarks. The renderer output is safe before mounting, with mount-boundary sanitization as defense in depth. The `msdoc-viewer` compatibility release containing the fix is 0.2.2. Thanks to @shashank420 for responsibly reporting this issue.

CVE-2026-91127 Affected File Viewer Versions

2 component(s)
Fixed Versions:
0.2.22.3.1
Product / Package Ecosystem Affected Versions Fixed Version
msdoc-viewer
npm
< 0.2.2
0.2.2
@file-viewer/doc
npm
< 2.3.1
2.3.1

References

Frequently Asked Questions

What is CVE-2026-91127?
CVE-2026-91127 is a security vulnerability in File Viewer involving DOM XSS via unsafe hyperlink schemes in the legacy DOC renderer under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which File Viewer versions are affected?
Affected versions include releases prior to 0.2.2, 2.3.1 across affected packages: msdoc-viewer, @file-viewer/doc.
What version fixes CVE-2026-91127?
Upgrading to 0.2.2, 2.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is msdoc-viewer affected?
Yes, msdoc-viewer is affected in releases prior to 0.2.2. Upgrade your dependency to 0.2.2 or later.
Is @file-viewer/doc affected?
Yes, @file-viewer/doc is affected in releases prior to 2.3.1. Upgrade your dependency to 2.3.1 or later.
What is the CVSS score of CVE-2026-91127?
CVE-2026-91127 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2026-91127?
CVE-2026-91127 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-91127?
Run the dependency tree command: 'npm ls msdoc-viewer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3753-m2x2-q623",
  "modified" : "2026-09-18T17:19:42Z",
  "published" : "2026-09-18T17:19:42Z",
  "aliases" : [ "CVE-2026-91127" ],
  "summary" : "File Viewer: DOM XSS via unsafe hyperlink schemes in the legacy DOC renderer",
  "details" : "### Summary\n\nBefore 2.3.1, the legacy `.doc` renderer emitted document hyperlink targets after HTML escaping but without a URL-scheme allowlist. A crafted `.doc` could therefore render a live `javascript:`, `vbscript:`, `data:`, or similarly unsafe link. Script could execute in the embedding origin if a viewer clicked it.\n\n### Impact\n\nApplications rendering untrusted legacy `.doc` files with `@file-viewer/doc` or the `msdoc-viewer` compatibility package could expose their origin to attacker-controlled script after link interaction.\n\n### Fix\n\nVersion 2.3.1 centralizes link handling, removes control-character and scheme confusion, blocks external document links by default, and in explicit allow mode accepts only HTTP(S), mail, telephone, safe relative URLs, and internal bookmarks. The renderer output is safe before mounting, with mount-boundary sanitization as defense in depth. The `msdoc-viewer` compatibility release containing the fix is 0.2.2.\n\nThanks to @shashank420 for responsibly reporting this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@file-viewer/doc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.3.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "msdoc-viewer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.2.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flyfish-dev/file-viewer/security/advisories/GHSA-3753-m2x2-q623"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flyfish-dev/file-viewer/commit/ef045680f8d9830a3eee9612f7df46a734361b07"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flyfish-dev/file-viewer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flyfish-dev/file-viewer/releases/tag/v2.3.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-83" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-18T17:19:42Z",
    "nvd_published_at" : null
  }
}