CVE-2026-132277
Quadratic memory blow via table indentation in Inscriptis 2.0‑2.7.5
- CVSS 5.3
- CWE-400
- Resource Management
- Remote
Inscriptis is a Python library for converting HTML to text. From 2.0.0 until 2.7.6, when the parent is block-level, table_end_handler() in model/tag/table_tag.py writes each sibling table through HtmlElement.write_verbatim_text() in model/html_element.py; Canvas.open_block() leaves the parent padding_inline prefix on the stack, Canvas.close_block() does not remove it, and only Canvas.close_tag() calls prefix.remove_last_prefix(). Each following sibling table therefore carries forward accumulated indentation, making get_text() output grow quadratically and allowing small attacker-controlled HTML to exhaust memory in applications converting it without authentication or user interaction. This issue is fixed in 2.7.6.
- CWE
- CWE-400
- CVSS base score
- 5.3
- Published
- 2026-11-20
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- Inscriptis 2.7.6
- Fixed by upgrading
- Yes
Solution
Upgrade Inscriptis to version 2.7.6 or newer.
Vulnerable code sample
from inscriptis import get_text
from inscriptis.model.html_element import HtmlElement
from inscriptis.model.canvas import Canvas
def extract_text(html: str) -> str:
# VULNERABLE: accumulated prefix causes quadratic memory growth
canvas = Canvas()
element = HtmlElement(html, canvas)
element.write_verbatim_text() # writes tables without resetting prefix
return canvas.get_text()Patched code sample
from inscriptis import get_text
from inscriptis.model.html_element import HtmlElement
from inscriptis.model.canvas import Canvas
def extract_text(html: str) -> str:
# FIX: reset prefix after each block to prevent accumulation
canvas = Canvas()
element = HtmlElement(html, canvas)
element.write_verbatim_text()
canvas.prefix.remove_last_prefix() # clear leftover block prefix
return canvas.get_text()Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: balance the verbatim-text block prefix so sibling tables do not accumulate padding (weblyzard/inscriptis)
src/inscriptis/model/tag/table_tag.py,src/inscriptis/model/tag/table_tag.py · table_end_handler
Cite this entry
@misc{vaitp:cve2026132277,
title = {{Quadratic memory blow via table indentation in Inscriptis 2.0‑2.7.5}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-132277},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-132277/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
