[ Reports & investigation ]

Prevent XML entity expansion and archive-bomb problems in report processing

Test decompression and XML resource boundaries independently, using small safe fixtures and explicit recovery criteria.

By the EmailAuth research team

[ Key points ]

  • Decompression and XML external-resource controls protect different boundaries.
  • Test small synthetic inputs under deliberately low limits.
  • Report unmeasured access or resource behavior as unverified.
On this page

Disabling external entities does not by itself protect a report processor from every resource-exhaustion input. A compressed attachment can expand before the XML parser starts, and deeply nested or oversized XML can consume resources without accessing an external entity. Treat decompression, XML interpretation and workload admission as separate defensive boundaries.

RFC 9990 explicitly identifies archive and XML resource-exhaustion risks. OWASP's XML guidance explains why parser-specific external-resource controls matter. The test design here is an operational recommendation to verify those boundaries in an isolated staging environment.

Define what must never happen

References: RFC 9990 §8.1.

The worker should not fetch attachment-selected network resources, read application secrets through XML resolution, write archive-supplied paths or consume unbounded CPU, memory or disk. Give it minimal filesystem access and no unnecessary network access. Use a disposable test environment with synthetic canaries rather than production secrets.

Set observable limits for compressed input, expanded output, parsing time, nesting, text length and simultaneous jobs. Record where each limit is enforced. A timeout around the final import cannot protect an earlier unbounded decompression step.

Check XML capabilities directly

Reference: OWASP XML external-entity prevention, General Guidance.

Configure the actual parser and any schema-validation or transformation layer. Disable unnecessary DTD processing, external entities, XInclude and external resource loading. Treat unsupported security settings as configuration failures. A safe parser setting can be undermined if a later validation stage fetches a schema chosen by the input. Review the whole processing chain, not only its first library call.

Use a tiny fixture containing an external reference to a controlled test sentinel. The expected behavior is rejection or safe non-resolution under the documented policy, with no sentinel access. Record network and file-access telemetry. Do not point test references at sensitive local files or external services you do not control.

Bound harmless expansion tests

References: RFC 9990 §8.1.

For decompression, use small synthetic content and intentionally low staging thresholds. For XML, use bounded nesting or internal expansion fixtures designed to trip similarly low limits. There is no need to create a genuinely enormous bomb to establish that a boundary is enforced.

Illustrative case: a test worker has a 256 KiB expanded-byte cap and a one-second processing deadline. A 300 KiB synthetic expanded stream should stop at the byte boundary. A separate tiny external-reference fixture should cause no lookup. Passing one case does not prove the other boundary works. The thresholds are illustrative, and actual memory and elapsed time must be measured rather than assumed.

Verify failure containment

For every rejected fixture, assert that no partial report records were committed, no unapproved output file appeared and the diagnostic contains a safe input reference and reason. Bound diagnostic size too, because copying the entire rejected document into logs creates another resource and privacy risk.

Submit a valid small report next. Check that queue processing recovers, temporary files are cleaned within the approved policy and replay does not create duplicate counts. Exercise concurrent arrivals within a safe test budget so aggregate worker limits are tested as well as per-file limits.

Make the test evidence repeatable

References: RFC 9990 §8.1, RFC 9990 §9.2.

Retain fixture hashes, parser and runtime versions, configuration, limits, expected outcomes and measured results. Repeat after dependency, parser, container or validation changes. If a test cannot observe external access or memory use, mark that part unverified rather than declaring the pipeline secure.

A rejection proves that a specific input encountered a specific boundary in the tested configuration. It does not prove every possible malicious document is harmless. Combine focused fixtures, reviewed configuration, isolation and monitoring, and maintain an owner for follow-up when any boundary fails.

The review package executes only a small bounded decompression demonstration and semantic models. External-reference, memory-isolation, concurrent-worker and actual database-containment tests described above remain acceptance requirements, not completed tests.

[ Takeaway ]

Report unmeasured access or resource behavior as unverified.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Test decompression and XML boundaries separately.

Measure external access and resource use. Verify clean recovery after rejection.

Next steps

  1. Test decompression and XML boundaries separately.
  2. Measure external access and resource use.
  3. Verify clean recovery after rejection.

CISO / SecOps

Review the full validation chain.

Require least privilege and isolation. Distinguish tested cases from universal assurance.

Next steps

  1. Review the full validation chain.
  2. Require least privilege and isolation.
  3. Distinguish tested cases from universal assurance.

Founder / Non-technical

Require a test owner and recovery criteria.

Keep production secrets out of fixtures. Track unresolved control failures to closure.

Next steps

  1. Require a test owner and recovery criteria.
  2. Keep production secrets out of fixtures.
  3. Track unresolved control failures to closure.

[ FAQs ]

Frequently asked questions

Does disabling XXE stop archive bombs?

No. Decompression has its own expansion and resource risks before XML interpretation.

RFC 9990 §8.1

Can schema validation reintroduce network access?

Yes, if it follows untrusted external locations. Review that layer separately.

Must tests allocate huge amounts of data?

No. Use small fixtures with low staging limits to verify the stopping behavior safely.

Where should external test references point?

Only to controlled synthetic sentinels in an isolated authorized environment.

What measurements are useful?

Expanded bytes, elapsed time, peak memory, file access, network access and committed-row count.

Should rejected documents be copied into logs?

Avoid unrestricted full-content logging. Retain a bounded diagnostic and protected input reference.

What proves recovery?

A subsequent valid fixture processes correctly without duplicate or partial metrics.

When should the suite run again?

After parser, runtime, decompressor, validation or isolation configuration changes.

[ Sources ]

Sources

  1. RFC 9990

    Sections §8.1 · §9.2

  2. OWASP XML External Entity Prevention

    Sections General Guidance

[ Glossary ]

Glossary

External entity
An XML entity whose replacement content is referenced outside the input document; unsafe resolution can expose resources.
Resource boundary
A configured and measured limit on work such as bytes, time, memory or concurrent jobs.
Synthetic sentinel
A controlled test resource used to detect unexpected access without exposing real secrets.

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base