Learn/Remade with RustDigital Freedom

A Safer XML Parser for Files That Stay on Your Device

rusty_xml, our memory-safe XML parser, shipped eight releases in a weekend. Hostile files now hit hard limits, and big documents need far less memory to stay local.

Signed by M·
A wooden letter tray on a home desk at dusk, a thick stack of paper held by a brass clip beside a closed laptop and a desk lamp
What makes rusty_xml 0.10 a safer XML parser?

rusty_xml is a memory-safe XML parser written in Rust with network loading and external entities off by default. The releases of November 13 to 15, 2026 bound entity expansion the way libxml2 does, cap deep HTML nesting, stop validation from blowing up on crafted schemas and let long jobs be cancelled. Large files also need far less memory.

rusty_xml, the memory-safe XML parser in our Remade with Rust family, shipped eight releases over the weekend of November 13 to 15, 2026. The short version for anyone who cares where their documents go: a hostile file now runs into hard limits instead of eating your machine, a slow job can be stopped, and very large files need a fraction of the memory they did on Friday. Lower memory is what lets a document be read on your own device instead of being shipped to somebody else's server.

Version 0.10.1 is on crates.io now. Every figure here comes from the project's public commits in the rusty_xml repository. We read them. We ran nothing. If rusty_xml is new to you, start with rusty_xml, libxml2 remade in Rust.

Why the XML parser under your files matters

You rarely see XML, and you open it every day. A modern Word, Excel or PowerPoint file is a zip package of XML parts under the Office Open XML standard, ECMA-376. So are SVG images, RSS feeds and a long tail of invoices, exports and settings files. Whatever reads those files runs an XML parser, and that parser decides what a crafted file can do to you.

The classic attacks are old and well documented. An XML bomb, or billion laughs, is a small file whose entities expand into gigabytes; MITRE catalogues it as CWE-776. An external entity attack, CWE-611, tricks the parser into fetching a local file or a network address and folding it into the output. The OWASP XXE prevention cheat sheet boils the defence down to configuring the parser safely, because defaults are where most tools fail.

rusty_xml starts from safe defaults: network loading and external entities are switched off by default, and there is no C code underneath. That is the Security primitive. Trust is keeping the file on your device. Incentive is making the safe XML parser fast enough that nobody reaches for the risky one. The weekend's work pushed on all three, and it lines up with the memory-safety practices in the NIST Secure Software Development Framework.

What the weekend's XML parser work refuses

The first releases of the weekend went into one promise: untrusted input cannot drive unbounded work.

Entity bombs hit a ceiling in the XML parser

From 0.9.1, entity expansion is bounded the way libxml2 bounds it. Once expansion passes 1,000,000 bytes, it may not exceed five times the input consumed, for general and parameter entities alike. A billion laughs file stops with an error instead of a memory spike. Real documents with heavy entity use still load. On Sunday the project fixed how external DTDs are read, including parameter entities that were being charged twice, and large published DTDs such as TEI P5 and DocBook 4.5 now load instead of being refused.

Deep and crafted documents cannot hang the XML parser

Depth used to be a quiet way to crash software, by nesting elements until the stack runs out. The rusty_xml README now states that nothing on the parse, save, XPath, canonicalize, XInclude or DTD paths recurses once per level of nesting. RelaxNG matching, which does recurse, refuses documents nested past a few hundred levels instead of overflowing. HTML parsing stops at libxml2's cap of 256 levels by default, and XPath work can be capped with an operation limit, as in libxml2.

Validation got the same treatment. A crafted schema could make the old checks multiply their work. After Sunday's release, the project measured 64 large repeated content models at 65 ms and 20 MiB, down from 4,266 ms and 2,093 MiB, and 100,000 sibling elements under a RelaxNG rule at 4.6 ms, down from 1,117 ms.

A slow XML parser job can be stopped

Sometimes the right answer is to give up. Parsing, XPath, the validators, canonicalization and saving now have interruptible versions that take a stop signal from the application, such as a deadline. In the project's test, a Schematron check on 16,000 elements with a 200 ms deadline used to run 1,505 ms and report success. Now it stops at 200 ms and says it was interrupted, so an app can cancel a hostile file rather than freeze on it.

Less memory keeps the XML parser local

Privacy fails quietly when a file is too big to process at home and gets uploaded "just this once". Memory is the line between those outcomes.

Big files on an ordinary machine

The weekend's biggest single change was streaming. When an app only needs to walk a file, rusty_xml 0.9.3 no longer builds a tree of it. On a generated 138 MB 3D-printing model file with 3 million elements, peak working memory fell from 434 MB to 136 MB, roughly the size of the file itself, and the run went from about 2.1 seconds to about 0.6 seconds on Windows.

Everyday documents and pages

Smaller files gained too. From 0.10.0, short names and text are stored inside each node instead of in separate memory blocks. Across 197 real web pages, the project measured parsing about 20 percent faster and trees holding 18 percent less memory. In 0.10.1, a 3.5 MB sparse document that used to peak at 32.8 MiB of committed memory now peaks at 5.8 MiB. Each figure compares a release with the one before it on the project's own files, not against another product, and the CPU was not published.

Where this XML parser reaches you

The nearest product is RAG Converter, which reads Word, Excel and PowerPoint through rusty_xml inside your browser tab, with nothing uploaded. Its current build uses the 0.8 line, so none of the weekend numbers are claims about RAG Converter today; the upgrade is the next step, and we will measure it first. The story of that private pipeline is in RAG Converter, private RAG remade with Rust, and you can try it at ragconverter.com.

Developers can read the engineering detail on remadewithrust.com. For why we keep rebuilding parsers like this one, read the importance of Remade with Rust and why Digital Freedom needs Rust. A safer XML parser is a small piece of Digital Freedom, and it is the piece that touches every document you own.

FAQ

Short answers already in this article.

What is an XML bomb?

An XML bomb, also called a billion laughs attack, is a small file whose entity definitions expand into an enormous amount of text when parsed. MITRE lists it as CWE-776. A parser that does not limit expansion can run out of memory or freeze the device trying to read it.

Are Word and Excel files really XML?

Yes. Modern .docx, .xlsx and .pptx files follow the Office Open XML standard, ECMA-376: a zip package of XML parts. Any tool that reads their text, including a converter that prepares documents for AI, runs an XML parser over what is inside.

How much memory does rusty_xml 0.10 save on big files?

On a generated 138 MB 3D-model file with 3 million elements, streaming mode in 0.9.3 peaked at 136 MB of working memory instead of 434 MB in 0.9.2, and finished in about 0.6 seconds instead of about 2.1 seconds on Windows. These are the project's own figures.

Does RAG Converter already use rusty_xml 0.10?

Not yet. RAG Converter reads Word, Excel and PowerPoint through rusty_xml, but its current dependency is on the 0.8 line, which does not include the weekend releases. Moving it to 0.10 is a separate change that will be measured before we claim anything about conversion speed.

Can I stop a slow XML parse in rusty_xml?

Yes. Parsing, XPath, the validators, canonicalization and saving have interruptible versions that take a stop signal, such as a flag or a deadline check. Since 0.10.1, DTD loading, XInclude and the pull reader accept the same signal through one settings type.