The Hidden PII Inside Word (.docx) Files: Track Changes, Comments & XML Metadata
A Word document is a ZIP archive of XML files. Even when the visible body text looks sanitized, Track Changes, reviewer initials, comments.xml, and custom document properties often leak everything.
Why Find-and-Replace Misses Split XML Runs
Microsoft Word rarely stores a full phrase like "Sarah Jenkins" inside a single contiguous text node. Spellcheck boundaries, formatting changes, or revision IDs frequently split names across adjacent <w:t> elements.
Simple string replacement searching each <w:t> node individually fails whenever "Sarah " sits in one run and "Jenkins" sits in the next. Anonymization must flatten paragraph text first, detect entities across the joined string, and rewrite the run sequence cleanly.
<w:del w:author="Secret Counsel"><w:r><w:delText>SSN 123-45-6789</w:delText></w:r></w:del> <w:p><w:r><w:t>Sarah </w:t></w:r><w:r><w:t>Jenkins</w:t></w:r></w:p>
<w:p><w:r><w:t>[PERSON_1]</w:t></w:r></w:p> <!-- Deleted runs excised, author redacted -->
Silent Leaks Inside the OOXML Archive
Before dropping a contract or consulting deliverable into an external workflow, four OOXML components outside visible paragraphs need sanitization:
- Deleted Revisions (<w:del>): Text you hit Backspace on while Track Changes was active remains inside word/document.xml until stripped or accepted.
- Reviewer Attribution (w:author / w:initials): Every <w:ins>, <w:del>, and comment stamps the author’s real name and initials.
- Review Margins (word/comments.xml): Internal partner notes often mention unredacted phone numbers, client names, or negotiation fallbacks.
- Core & Custom XML Properties (docProps/core.xml, app.xml, custom.xml): Creator, LastModifiedBy, Keywords, Manager, and CRM property bags regularly identify the drafting firm.
Key Takeaways
- ✓Flatten <w:p> run boundaries before running entity detection so split names are never missed.
- ✓Strip <w:del> elements completely and scrub word/comments.xml alongside headers and footers.
- ✓Wipe docProps/core.xml, app.xml, and custom.xml before distributing anonymized Word drafts.
Anonymize .docx body runs, strip Track Changes & comments, and preserve formatting locally.