DOCX Security and Privacy: Hidden Data to Check

November 08, 2026 · DOCX.now Editorial · DOCX Essentials

Review active content, parser risks and hidden metadata before opening or sharing DOCX files.

Why Hidden Data Persists in DOCX

A DOCX file is a ZIP archive conforming to the Open Packaging Conventions. The specification (MS-DOCX §3.1) requires all package parts to remain accessible unless explicitly stripped by an application. Normal viewing renders only the document body, but the archive retains revision identifiers, embedded media, application-level metadata, and relationship files. This data survives copy-paste operations, cloud synchronization, and format conversion unless actively removed with tools that understand the OPC structure.

Active Content Risks in DOCX

Macros and Embedded Executables

A standard .docx file should not contain executable macros, but the ZIP container imposes no such restriction. The presence of word/vbaProject.bin indicates VBA macro storage. Some parsers, including LibreOffice and older Word Online versions, may attempt to interpret embedded OLE objects regardless of file extension.

Validation check:

  1. Rename the file extension from .docx to .zip and extract the archive.
  2. Inspect for word/vbaProject.bin or a word/activeX/ directory.
  3. Either finding confirms executable code exists inside the container, even if the .docx extension suppresses standard macro warnings.

External Resource Links

[Content_Types].xml and word/_rels/document.xml.rels can contain Relationship elements with TargetMode="External". These targets may reference HTTP/S URLs, local file paths using the file:/// scheme, or UNC network share paths. Word resolves these targets on document open.

Audit command (after ZIP extraction):

grep -r 'TargetMode="External"' word/_rels/document.xml.rels

Any Target attribute value that does not begin with https:// requires inspection. Local file path references can leak directory structures; UNC paths can trigger authentication handshakes to internal servers.

Hidden Metadata Layers

Core and Application Document Properties

docProps/core.xml stores Dublin Core metadata: dc:title, dc:creator, cp:lastModifiedBy, cp:revision, and dcterms:created. docProps/app.xml stores application-level data: TotalTime (editing duration in minutes), Characters, Paragraphs, and the full font table.

Observable check: Extract both files and inspect for lastModifiedBy values that identify editors no longer associated with the document, or TotalTime values that contradict the stated creation timeline.

Revision Session IDs (rsid)

Every editing session generates a unique 8-digit hexadecimal rsid. These are stored as attributes in word/document.xml: w:rsidR (paragraph revision), w:rsidRPr (formatting revision), and w:rsidDel (deletion marker). By correlating rsid values across paragraphs with core.xml creator timestamps, an analyst can reconstruct the sequence and authorship of edits.

rsid density check:

grep -oP 'w:rsidR="[^"]+"' word/document.xml | sort -u | wc -l

Hard limit: More than 10 unique w:rsidR values indicates multi-session editing history. A single rsid dominating fewer than 90% of paragraphs signals collaborative or iterative revision.

Thumbnail Previews

Word automatically generates a 256×256 pixel PNG thumbnail of the first page and stores it at docProps/thumbnail.jpeg. The Inspect Document tool in Word does not remove this file. If the first page contained content later deleted or redacted, the thumbnail preserves a visual record.

Extraction:

unzip -p document.docx docProps/thumbnail.jpeg > preview.png

Visually inspect preview.png for content absent from the current document body.

Parser-Specific Data Leakage

Comment and Track Changes Residue

Comments "deleted" through the Word UI often persist in word/comments.xml with intact w:author and w:date attributes. Accepted tracked deletions remove <w:del> elements from word/document.xml, but the same deletions may survive in word/endnotes.xml or word/footnotes.xml if the deletion range spanned a note boundary.

Existence check:

grep -c 'w:comment\|<w:del ' word/document.xml

A nonzero count confirms editorial markup remains in the file. Repeat the check against word/comments.xml, word/endnotes.xml, and word/footnotes.xml.

Embedded Font Subsetting

Fonts embedded in word/fonts/ contain only the glyphs used in the document. The word/fontTable.xml file records embedding license flags via <w:embedRegular> and <w:embedBold> elements, each containing a w:fontKey attribute. This fontKey is a hash that uniquely identifies the font version. Redistributing the DOCX may violate the font vendor's license if the embedding flag is set to restricted or printAndPreview.

Check: Open word/fontTable.xml and inspect the w:embedRegular elements. Any w:fontKey value tied to a commercial font with restrictive licensing creates redistribution liability.

Verification Workflow

Stage 1: Structural Scan

unzip -l document.docx | grep -E 'vbaProject|thumbnail|comments|endnotes|footnotes|embeddings'

Any matching path indicates active content or residual editorial data. Presence of word/embeddings/ signals embedded OLE objects.

Stage 2: Metadata Extraction

python3 -c "
import zipfile, xml.etree.ElementTree as ET
with zipfile.ZipFile('document.docx') as z:
    for name in ['docProps/core.xml', 'docProps/app.xml']:
        if name in z.namelist():
            tree = ET.parse(z.open(name))
            root = tree.getroot()
            for elem in root.iter():
                if elem.text and elem.text.strip():
                    tag = elem.tag.split('}')[-1]
                    print(f'{name}: {tag} = {elem.text[:120]}')
"

Flag any lastModifiedBy, revision, TotalTime, or created value that cannot be attributed to the intended document history.

Stage 3: rsid Pattern Analysis

grep -oP 'w:rsid[^=]*="[^"]*"' word/document.xml | sort | uniq -c | sort -rn | head -10

A single rsid with high frequency suggests a clean single-session document. Multiple rsids with comparable counts indicate collaborative editing that may have left revision artifacts in other XML parts.

Unrecoverable Limits

  • Accepted deletions spanning note boundaries: When a tracked deletion that includes a footnote or endnote reference is accepted, the <w:del> element is removed from document.xml but the corresponding note body in word/endnotes.xml or word/footnotes.xml may remain unreferenced rather than deleted.
  • Cloud service overlay metadata: Google Workspace and Office 365 inject additional identifiers (e.g., w14:paraId in the w14 namespace) that standard DOCX metadata cleaners do not target. These identifiers persist through download and local save operations.
  • Encrypted embedded objects: Password-protected embedded files inside word/embeddings/ cannot be inspected without credentials, but their existence is visible in word/embeddings/_rels/. The file names and relationship targets alone may disclose sensitive information.
  • Arbitrary ZIP additions: The OPC specification permits arbitrary files within the archive. Standard metadata removal tools operate on known paths only. A file added at a custom path survives all automated cleaning.

No tool guarantees zero residual data. The only definitive method is to extract the plain text content body, discard all original XML parts, and rebuild the DOCX from a clean template.