Learn More about Benny Czarny's Book Cybersecurity Upside Down

Learn More
We utilize artificial intelligence for site translations, and while we strive for accuracy, they may not always be 100% precise. Your understanding is appreciated.

How Deep CDR™ Technology Handles Files Crafted To Crash Its Parsers with Distrustful Decomposition

Deep CDR™ Technology keeps file flows running when a hostile file arrives.
By Nhut Ngo

Every file sanitization engine will eventually meet a file crafted to break the software that reads it. OPSWAT built Deep CDR™ Technology so that moment costs one process, while the engine keeps sanitizing everything else.

Why Parsers Are the Target

A parser is the code that reads a file format and turns its raw bytes into a structure software can work with. Every format needs a parser. Formats such as PDF and Microsoft Office are complex enough that their parsers carry real risks, and attackers build files specifically to exploit them. A file crafted to crash or subvert a PDF parser is a standard weapon.

A sanitization engine needs to take these files apart, which means parsing them. In a monolithic design, such engines can be seen as one single program, with all of their parsers sharing one process. One malformed PDF that takes the parser down takes everything down with it: the Word documents queued behind it, the engine itself, and the business workflows the engine protects.

The blast radius of one parser’s bad day is the whole engine.

A Design Built on Distrust

Deep CDR™ Technology’s microservice architecture applies a secure design pattern called distrustful decomposition. The pattern splits a system into separate programs that check one another and extend no automatic trust.

Carnegie Mellon University’s SEI (Software Engineering Institute) catalogs the pattern in its Secure Design Patterns report, using mail servers such as qmail and Postfix as reference examples.

Deep CDR™ Technology applies such pattern’s decomposition and mutual distrust through three design decisions:

  1. Every parser runs as a replaceable process. The engine core never touches untrusted bytes. Each parser family runs in its own service process, launched and owned by the core. The process that opens the hostile file is precisely the one the engine can afford to lose, because it holds one request’s work and nothing else.
  2. The core treats its own workers as suspects. The core takes no worker’s health on faith. It checks regularly that each service still responds, gives every file a time limit, and watches for hangs and crashes. When a service stops responding, the core’s monitor shuts it down and starts a fresh one. The design assumes failures will happen and plans for them.
  3. Services and core share no memory. Services talk to the core over narrow, serialized message channels, with no shared memory and no shared address space. Whatever a malicious file does to a parser’s memory, the damage has no road into the core or the other services. The only thing that crosses the boundary is a message the receiver parses on its own terms.

Consider the scenario this design was built for. A crafted PDF reaches the engine and crashes the PDF service whilst it parses the file.

The same crafted PDF, two outcomes. The monolith loses everything. The decomposed engine loses one expendable process and relaunches it.
  • The PDF service process dies alone. Its memory, and whatever the exploit corrupted in it, disappears with it
  • The request fails cleanly: the core reports an error result for that one file instead of hanging or dying with the worker
  • The Word and Excel documents in flight never notice. Their services run in different processes, so sanitization continues uninterrupted
  • The watchdog (core’s monitor) relaunches the PDF service, and PDF sanitization resumes

The blast radius of a weaponized file is one process and one request. In the monolithic outcome, the same file stops every document in flight.

One dimension of the textbook pattern sits outside the engine: per-process privilege limitation. Privileges belong to the deployment environment, meaning the host product and the operating system. The decomposition draws process boundaries exactly where a deployment can layer those restrictions on, which gives security teams clear places to apply least privilege.

What This Means For Your File Flows

Attackers will keep crafting files that fight back, and some parser somewhere will keep meeting them. Distrustful decomposition makes that encounter survivable by design. The dangerous work happens in processes the engine can lose. A core that trusts none of them watches over that work, and channels that corruption cannot cross connect the parts.

For teams that depend on file flows, a single hostile upload does not become an outage. One bad file costs one process and one request, and Deep CDR™ Technology keeps sanitizing without disruption.

Find out how Deep CDR™ Technology keeps file flows running when a hostile file arrives.

how deep cdrtm handles files crafted to crash its parsers with distrustful decomposition 3
read once protect everything how deep cdrtm doubles speed on large office files 4
Author Bio

Nhut Ngo is Director of Software Engineering at OPSWAT, where he leads the engineering teams behind Deep CDR™ Technology and other file-processing technologies in MetaDefender Core™. With more than a decade of experience in software engineering and cybersecurity, he focuses on making file sanitization fast, accurate, and ready for critical infrastructure. Nhut earned his PhD in Information Science in 2015.

Nhut Ngo
Director of Software Engineering

Stay Up-to-Date With OPSWAT!

Sign up today to receive the latest company updates, stories, event info, and more.