GHSA-3753-m2x2-q623: XSS
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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/msdoc-viewerto a version that resolves this vulnerability.Fixed in 0.2.2 - Upgrade
Upgrade
npm/@file-viewer/docto a version that resolves this vulnerability.Fixed in 2.3.1 - Upgrade
Upgrade
@file-viewer/doc (legacy .doc renderer) / msdoc-viewer compatibility packageto a version that resolves this vulnerability.Fixed in 2.3.1 - Upgrade
Upgrade
msdoc-viewer compatibility packageto a version that resolves this vulnerability.Fixed in 0.2.2 - Compensating control
Use mount-boundary sanitization as defense in depth for rendered untrusted legacy .doc files.
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Applications that render untrusted legacy .doc files using @file-viewer/doc or the msdoc-viewer compatibility package are exposed. The risk is to the application's embedding origin when rendered content is interacted with.
What must an attacker do to trigger the vulnerability?
An attacker needs to provide a crafted legacy .doc containing a hyperlink with an unsafe URL scheme, such as javascript:, vbscript:, or data:. A user must click the rendered link for script to execute.
Are external document links allowed by default after updating?
No. Version 2.3.1 blocks external document links by default. When explicit allow mode is used, only HTTP(S), mail, telephone, safe relative URLs, and internal bookmarks are accepted.
Which versions contain the fix?
The fix is included in @file-viewer/doc version 2.3.1 and the msdoc-viewer compatibility release 0.2.2.