Summary
A cross-site scripting vulnerability in the legacy DOC renderer allows document-controlled hyperlinks to be emitted into generated HTML without sufficiently restricting their URL schemes. When a user clicks a crafted link in an embedding application, script may execute in that application's origin.
Affected context
The issue affects applications embedding File Viewer components that use the legacy DOC renderer in versions before the relevant fixes. Risk is present when a user opens a crafted legacy DOC file, external document links are enabled or otherwise permitted, and the rendered hyperlink is displayed in the application's security origin.
Exploit preconditions
- Attack surface: HTML generated by the legacy DOC rendering component - Required access: Ability to provide or cause a user to open a crafted DOC
document
- Trigger point: User interaction with a rendered document hyperlink - Why exploitation is possible: Document-controlled link targets are escaped
as text but are not adequately restricted to safe URL schemes before being
inserted into generated HTML
Why this happens
The underlying bug is incomplete output and URL-context validation. Character escaping protects markup characters but does not make every URL scheme safe. When document-controlled hyperlink targets are inserted into HTML without an allowlist or equivalent scheme policy, browser navigation behavior can treat the value as executable script content. This maps primarily to CWE-79, Cross-Site Scripting, and is also related to CWE-83, Improper Neutralization of Script-Related HTML Tags in a Web Page.
Potential impact
- Arbitrary script may execute in the embedding application's origin
- Session information or application data could be exposed
- Application actions may be performed on behalf of an affected user
- Users could be redirected to untrusted destinations
- Integrity of displayed documents or surrounding application workflows could be affected
General mitigation guidance
Mitigation generally focuses on treating document links as untrusted content and enforcing a secure URL policy before HTML generation. Secure-by-default behavior can disable external document links unless an application explicitly enables them. If links are allowed, implementations can restrict them to HTTP(S), mail, telephone, safe relative URLs, and internal bookmarks, while rejecting executable or otherwise unsafe schemes. Context-aware HTML sanitization, mount-boundary or container-boundary checks, and a strict content security policy can provide additional defense in depth. Applications should reduce input trust, isolate document rendering where practical, and run viewers with only the privileges required for their function.
How teams detect issues like this
Detection approaches include static analysis for document-derived values flowing into HTML attributes or hyperlink targets without URL-scheme validation, and code review checks for escaping used as a substitute for contextual sanitization. Security tests can exercise supported document formats with benign links using disallowed schemes and verify that links are blocked or neutralized. Policy enforcement can require centralized URL allowlists, safe-by-default viewer configuration, and content security policy controls. Automated security review tools may help identify unsafe DOM or HTML-generation patterns.

