Small HTML file can exhaust memory in Inscriptis text converter
A flaw disclosed on 20 November 2026 lets a 240 KB page balloon into a billion characters, hitting crawlers and LLM ingestion pipelines.
By The Agentic Times ·

A denial-of-service flaw in Inscriptis, a Python library that converts HTML into plain text, allows a small untrusted web page to exhaust a host's memory, according to a GitHub security advisory published on 20 November 2026. The issue is tracked as CVE-2026-132277 and GHSA-q87h-c5m7-659j, and affects the inscriptis package on PyPI.
The advisory says the problem lies in how the library handles sibling <table> elements. Every additional table adds another level of the parent element's indentation, so the size of the get_text() output grows quadratically with the number of tables in the document. The advisory reports that a 240 KB HTML document produces roughly one billion characters of output and consumes about 1 GB of memory.
Technically, the advisory traces the fault to table_end_handler() in model/tag/table_tag.py, which writes the rendered table into its parent element using write_verbatim_text(). For a block-level parent, that call opens a block and pushes the parent's inline padding onto a prefix stack. The matching close_block() never removes it, because only Canvas.close_tag() calls remove_last_prefix(). Each table therefore leaves one extra padding entry behind, and indentation accumulates.
The advisory includes measurements taken with inscriptis 2.7.5 on Python 3.11 under macOS. A document containing 1,000 empty tables, 15 KB in size, produced 4 million characters in 0.02 seconds and peaked at 31 MiB of resident memory. At 4,000 tables, a 60 KB input produced 64 million characters and 154 MiB. At 8,000 tables, a 120 KB input produced 256 million characters and 463 MiB over 1.31 seconds. At 16,000 tables, the 240 KB input produced 1,024 million characters and 991 MiB over 5.63 seconds. Each doubling of the input roughly quadrupled both output size and memory use, the advisory says.
According to the advisory, the behaviour has been present since version 2.0, introduced in commit 84ec720, and version 2.0.0 behaves the same way as the current release. A short proof-of-concept script is published with the report, along with a one-line example showing four nested-looking tables rendered with progressively deeper indentation from flat input.
On impact, the advisory states that any application converting untrusted HTML with Inscriptis can be made to exhaust memory with a small document. It specifically names crawlers, retrieval-augmented generation and large language model ingestion pipelines, and inscriptis-api, the library's HTTP service wrapper. No authentication and no user interaction are required to trigger the condition.
That combination is the practical concern for agent builders. HTML-to-text conversion is a routine step in pipelines that fetch pages and feed them to a model, and the attacker in that scenario only needs to control a page the system is willing to read. A single crafted document, well under a megabyte, is enough to push a worker process into heavy memory use.
The advisory publishes a fix as a two-line patch: calling prefix.remove_last_prefix() on the current block before close_block() when the element's display type is block. With that change applied, the advisory reports that the same 240 KB input produces 288,000 characters in 0.14 seconds with a peak of 27 MiB. It adds that a single table renders exactly as before and that the existing test suite passes.
Operators running Inscriptis on untrusted input should check the advisory for the fixed release and consider size or time limits on conversion in the meantime.
Sources
- github.comhttps://github.com/advisories/GHSA-q87h-c5m7-659j
