When File Ingestion Misleads Language Models: Measuring and Mitigating Divergences in Office Documents

Penghui LiarXiv 2026

TL;DR

Large Language Models (LLMs) don't "see" Office documents the way humans do; they rely on text extractors that often misinterpret the underlying XML structure. This paper identifies "extraction divergence"—a new attack surface where adversaries can manipulate files so that a human sees one thing while an LLM sees another, successfully misleading every major AI assistant tested (including ChatGPT, Claude, and Gemini) without needing a single line of malicious prompt injection.

What Problem Does This Paper Address?

When you upload a Word, Excel, or PowerPoint file to an AI, the system rarely "looks" at a rendered image of the page. Instead, it uses a text extractor to pull data from the document’s underlying Office Open XML (OOXML) files—a complex format where content is spread across multiple XML parts inside a ZIP archive.

The problem is that these extractors are often inconsistent. They might read "hidden" text that a human can't see, ignore display formatting that changes a number's value, or scramble the reading order of text boxes. This gap between the human view (what Office apps render) and the model view (what the extractor provides) creates a "parser differential" that attackers can exploit to feed LLMs misinformation while appearing perfectly benign to human reviewers.

Figure 2: Package structure of an XLSX file. Content and formatting are spread across XML parts linked by relationship files.

Methods

The authors conducted a multi-stage study to map and mitigate these risks:

  1. Hybrid Program Analysis: They combined static analysis (modeling how libraries map XML elements to objects) with dynamic analysis (placing "canary" strings in various XML locations) to test 10 popular open-source extractors like markitdown and python-docx.
  2. Attack Construction: Based on identified divergences, they built five attack scenarios:
  3. Hidden Injection: Placing text in invisible channels (e.g., image alt-text or vanished runs).
  4. Silent Omission: Putting critical info in footers or headers that extractors skip.
  5. Formatting Divergence: Using Excel's custom number formats to scale values (e.g., storing 1,000,000 but displaying $1,000).
  6. Spatial Order Inversion: Reordering text boxes on a slide so the extractor reads them in a different sequence.
  7. Sub-word Regrouping: Combining hidden and visible text to change word meanings (e.g., hidden "un" + visible "authorized").
  8. Defense (Prism): They developed a lightweight tool that reconstructs the human view by strictly following the OOXML specification for visibility and formatting, only falling back to an expensive "render oracle" (using vision-language models) for ambiguous layout cases.

Datasets

  • Prevalence Study: The authors analyzed 2,229 real-world Office files harvested from the govdocs1 corpus and national open-data portals to see how often "attack-enabling" features (like hidden rows or scaling formats) occur naturally.
  • Evaluation Suite: They created a benchmark of 5 attack scenarios and 28 additional attack payloads to test against 8 LLM systems.

Key Insights and Ideas

  • Attacks without Instructions: Unlike "prompt injection," these attacks require no malicious commands. The LLM is misled simply because it is given a different version of reality than the human user.
  • The Cost of Extraction: Text extraction is roughly 100x cheaper than rendering a document for a Vision-Language Model (VLM). This economic pressure ensures that vulnerable text-based ingestion remains the industry standard.
  • Benign Features as Weapons: The features exploited (like Excel's number scaling) are common in legitimate documents. For instance, 7% of spreadsheets in the wild use value-altering number formats. This makes detection via simple structural flags nearly impossible without causing massive false positives.
Table 3: Prevalence of the measured injection, omission, and format- ting primitives in real documents.

Key Results

  • Widespread Vulnerability: Every one of the 8 tested systems (4 chat assistants and 4 coding agents) was misled by at least one attack. The overall success rate for attacks across all systems was 64%.
  • Gemini's Failure: Google's Gemini was misled in 100% of the trials across all five attack scenarios.
  • Formatting is the Weakest Link: The "Formatting Divergence" attack (changing numbers via Excel styles) was the most effective, misleading 7 out of 8 systems in at least 90% of trials.
  • Prism's Effectiveness: The proposed defense, Prism, mitigated every attack scenario and all 28 additional payloads, correctly reconstructing the human view in 0.5ms per document—far faster than the extractors it replaces.
Figure 6: Spatial order inversion. The slide visually reads “Contrac- tor indemnifies Client.” The shape tree lists the boxes right to left (circled). Each box is also raised by one coordinate unit relative to its left neighbor. Both the shape-tree order and a strict (𝑦,𝑥) sort therefore yield “Client indemnifies Contractor.”

Limitations and Future Work

  • Non-Exhaustive Measurement: The study focused on 10 extractors; proprietary pipelines in commercial LLMs might have other, undocumented divergences.
  • Vision-Language Model (VLM) Costs: While Prism's "render oracle" is accurate, it is slow (~12s per document) and relies on commercial VLMs, which are themselves black boxes.
  • Scope: The study did not cover legacy binary formats (like .doc or .xls) or other packaged formats like OpenDocument, though the authors suggest their methodology would apply there as well. Future work is needed to address "visual" attacks, such as text that is technically visible but too small for a human to read.

Summary updated

Abstract

Office documents are now routinely uploaded to large language models (LLMs) for processing. However, an LLM does not always see what a human sees, because it typically reads the text that an extractor produces from the document's underlying Office Open XML (OOXML) files. Depending on the implementation, extractors differ in which OOXML parts they read and how they interpret them, so their output can differ from what Office applications display. For example, by slightly shifting the positions of text boxes on a slide, an adversary can swap the order in which the model reads them while the slide looks unchanged. We show that this extraction divergence is an attack surface for LLM applications. In this work, we first measure what an adversary can exploit by analyzing the widely used extractors that LLM applications rely on. By combining static source code analysis with dynamic analysis, we identify 19 OOXML channels where extractors read content a human cannot see and 12 where they drop content a human can. We also find that widely used extractors ignore display formatting and reading order, so even visible content reaches the model in a different form. Building on these findings, we construct five attacks that lead the model to interpret a document differently from a human reviewer, without injecting any instruction. We test the attacks on four major chat assistants (ChatGPT, Claude, Gemini, and Microsoft 365 Copilot) and four coding agents (Codex, Claude Code, Antigravity, and GitHub Copilot CLI), and every one of them is misled by at least one attack. Finally, we propose Prism, a lightweight defense that reconstructs the human view from the OOXML specification before passing the text to the model. Prism also generalizes to unseen attack payloads.
BibTeX
@misc{li2026when,
  author = {Penghui Li},
  title = {{When File Ingestion Misleads Language Models: Measuring and Mitigating Divergences in Office Documents}},
  year = {2026},
  eprint = {2611.05806},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.05806},
}
Figure