CVE-2026-91127 is a high-severity (CVSS 8.2) Cross-site Scripting (XSS) vulnerability in @file-viewer/doc. A fix is available for @file-viewer/doc — see the affected versions and patch details below.
File Viewer: DOM XSS via unsafe hyperlink schemes in the legacy DOC renderer
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@file-viewer/docnpmmsdoc-viewernpmDescription
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @file-viewer/doc | all versions | 2.3.1npm install @file-viewer/doc@2.3.1 |
| 📦npm | msdoc-viewer | all versions | 0.2.2npm install msdoc-viewer@0.2.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @file-viewer/doc, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @file-viewer/doc to 2.3.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-91127 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-91127 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-91127. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-91127 in your dependencies?
O3 Security finds CVE-2026-91127 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.