Skip to Content
Fetlar
Reference

Limits and safety

How Fetlar protects you from hostile files, and the limits it applies.

Office files from the internet are untrusted. Fetlar is built to read them safely.

How files are read

  • XML is parsed without DTDs or entity expansion.
  • The number of zip parts and their expanded size are checked before anything is read.
  • Cells, slides, sheets and nesting depth are capped. Very deep nesting is read as plain text instead of recursing.
  • Damaged zip files are recovered from their local headers, as Word and LibreOffice do.
  • Fetlar is fuzz-tested on mutated real-world files.
  • Macros are never run. Fields and links in files you read are never followed.
  • Fetlar works offline. It does not open network connections to read a file.

A file that crashes Fetlar, hangs it, or makes it use too much memory is a security bug.

Limits

WhatLimit
Excel cells read2,000,000 non-empty cells. Change with --max-cells. The cut is reported
Timenone by default. --timeout SECS gives up with exit code 75
Files over a safety limit (expanded size, number of parts)refused, exit code 75
Template placeholders400,000
Template XML elements12 million
Template compiled output384 MB
Template blocks per part200,000
XML in a template256 MB in all
Block nesting64 deep
Loop iterations20 million
Fill output2 GB
One value1 million characters
One picture10 MB
Excel loopa loop that would pass row 1,048,576 is refused (exit code 75)
Index: time per file120 seconds. Change with --timeout
Index: file size200 MB. Change with --max-mb
Index: memoryabout 1 GB of file data at once, whatever the number of threads
Word table width on exportWord's 63 columns, wider tables are split

MCP limits are in Environment variables.

Threads and memory

FETLAR_THREADS=1 uses the least memory. On an ordinary file Fetlar uses about 5 MB.

What is left out of reading

Hidden text, text smaller than 2 pt, deleted tracked changes, comments, hidden sheets, rows, columns and slides. See Reading files.

Reporting a problem

Report security problems privately, not in a public place. Include the file, or a description of how to build one.

On this page