Guide
Office: detect external links in documents
An Office file can point to targets outside the document: images, templates, workbooks or data sources. That is often legitimate but can trigger connections on opening. ScanBeforeOpen reads only the mapping in the package and calls no target.
Responsible operator: Tom Silas Helmke, operator of ScanBeforeOpen. Content revised: .
Where external links hide in an Office file
Modern Office files (docx, xlsx, pptx) are ZIP packages of XML parts. References are not in the text itself but in relationship files ending in .rels. There an entry maps an identifier such as rId5 to a target. The attribute TargetMode External marks a target outside the package.
Typical external targets are linked images that are not embedded, an attached document template, hyperlinks and, in Excel, links to other workbooks and data connections. The format is described in ECMA-376.
The sequence in words
- A .docx, .xlsx or .pptx is a ZIP package of XML parts and media. You can look into it with an archive program.
- The text holds no link target, only a relationship ID such as rId5.
- The relationships file maps rId5 to a target. TargetMode External means the target lies outside the package, such as an image, a template, a workbook or a hyperlink.
- Whether Office loads the target depends on relationship type, program version and settings. According to Microsoft, Excel and PowerPoint block external content such as images and data connections by default.
- ScanBeforeOpen reads only the relationships file and counts targets with TargetMode External. It calls no target and does not distinguish between image, template and plain hyperlink.
Detection is not the same as loading
An entry in the package is at first only a mapping. Whether Office actually fetches the target depends on the relationship type, the program version, Protected View and the Trust Center settings. According to Microsoft, Excel and PowerPoint are configured by default to block external content such as images, linked media, hyperlinks and data connections. For workbook links, Excel lets you choose whether to ask, update or not update when opening. For Word this source gives no separate statement, so behavior may differ by version.
If a target is loaded, the other side learns that and when the file was opened. With data connections, foreign content can enter the file. If a path points to a network share, Windows may try to sign in there. Which of these consequences occurs cannot be read from the package alone.
What ScanBeforeOpen shows and what it does not
The scanner reads the relationship files, counts entries with TargetMode External and also reports structures for external workbook links and hints of data connections. It never calls a target, not even in the preview.
It does not distinguish between an image, a template and an ordinary hyperlink. A document with a harmless link therefore gets the same finding as one with a remote template. The finding says that external targets exist, not whether or when they are loaded. No cleaned export is offered for Office files.
The example file contains two external relationships with addresses on the reserved .invalid top level domain. Neither is used in the document text, so nothing can be loaded.
Protective measures and sensible checks
Keep unknown files in Protected View and enable editing or content only if you know the source. Keep external content blocked in the Trust Center and answer prompts about links with No as long as you do not trust the sender.
In Excel, the workbook links management shows which sources are registered. Before passing on your own files, check links and document properties and remove whatever should not travel along.
Reproducible synthetic example
The DOCX contains two external relationships with addresses on the reserved .invalid top level domain. Neither is used in the text, so nothing is loaded. office.relationship only reports that external targets are registered.
The findings come from an actual local scan of this test file. Download it and choose it in the scanner. No real personal data or malware.
Download test file: external-links-demo.docxExample inspection coverage: partial.
Practical checklist
- Keep unknown Office files in Protected View
- Enable editing and content only for known sources
- Keep external content blocked in the Trust Center
- Decline prompts about links and data connections when in doubt
- Read the scanner finding as a hint about targets, not as proof of loading
- Check links before passing on your own files
Clear limits
The check counts relationship entries and structure hints but does not evaluate targets or check whether Office loads them. No cleaned export exists for Office files. Neither green nor a single finding is a safety clearance.
FAQ
Does ScanBeforeOpen load external targets from the file?
No. The scanner reads the relationship file locally and calls no address. The preview loads nothing externally either.
Is every external relationship dangerous?
No. Ordinary hyperlinks and linked images are often legitimate. The scanner does not distinguish the types and reports them alike.
Does a missing finding mean nothing is loaded?
No. The check is a pattern search in limited parts of the package. Nested or unusual structures may go unnoticed.
Received a suspicious file?
Scan it locally before opening, extracting, forwarding, or feeding it to an AI system.
Open scanner