llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · inscriptis

GHSA-Q87H-C5M7-659J

Inscriptis: Quadratic memory growth from sibling <table> elements in get_text()

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión2.7.6
Exposición22 hDesde la divulgación, 20 nov 2026, 6:48 p. m.
Detección15 minDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (media) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Ni el CISO se despertaría por esta.Tu backlog la recibirá con los brazos abiertos.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
06:48 p. m.
07:00 p. m.
05:12 p. m.
06:48 p. m.
12:24 a. m.
06:00 a. m.
11:36 a. m.
05:12 p. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-Q87H-C5M7-659J divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

Every sibling `<table>` adds another level of the parent's indentation, so the size of `get_text()` output grows quadratically with the number of tables. In the measurements below, a 240 KB HTML document produces about 1 billion characters and uses about 1 GB of memory.

Details

`table_end_handler()` (`model/tag/table_tag.py`) writes the rendered table into the parent element with `HtmlElement.write_verbatim_text()` (`model/html_element.py`). For a block-level parent, `write_verbatim_text()` calls `canvas.open_block()`, which pushes the parent's `padding_inline` onto the prefix stack. The following `close_block()` never pops it; only `Canvas.close_tag()` calls `prefix.remove_last_prefix()`. So each table leaves one extra padding entry on the stack.

This has been present since 2.0 (commit 84ec720).

>>> get_text('<ul>' + '<table><tr><td>a</td></tr></table>' * 4 + '</ul>')
'        a\n        \n            a\n            \n                a\n                \n                    a\n                    '

PoC

import sys, time, resource
from inscriptis import get_text

n = int(sys.argv[1])
html = "<ul>" + "<table></table>" * n + "</ul>"
t = time.time(); out = get_text(html)
print(len(html), f"{time.time()-t:.2f}s", len(out), resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 2**20, "MiB")

inscriptis 2.7.5, Python 3.11, macOS (2.0.0 behaves the same):

| tables | HTML | time | output chars | peak RSS |
|---|---|---|---|---|
| 1,000 | 15 KB | 0.02 s | 4.0 M | 31 MiB |
| 4,000 | 60 KB | 0.33 s | 64 M | 154 MiB |
| 8,000 | 120 KB | 1.31 s | 256 M | 463 MiB |
| 16,000 | 240 KB | 5.63 s | 1,024 M | 991 MiB |

When the input doubles, output size and memory grow about 4 times.

Impact

Any application that converts untrusted HTML with inscriptis can be made to exhaust memory with a small document. This includes crawlers, RAG and LLM ingestion pipelines, and `inscriptis-api`. No authentication and no user interaction are needed.

Fix

         self.canvas.write(self, text, whitespace=WhiteSpace.pre)

         if self.display == Display.block:
+            self.canvas.current_block.prefix.remove_last_prefix()
             self.canvas.close_block(self)

With this change the 240 KB input above produces 288 K characters in 0.14 s with 27 MiB peak RSS. A single table renders exactly as before, and the existing test suite passes.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida
inscriptis≥ 2.0.0 < 2.7.6
2.0.0
2.7.6
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
PyPIinscriptis
Corregida 2.7.6 — —
Versiones corregidas2.7.6
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-132277
Otrahttps://github.com/weblyzard/inscriptis/security/advisories/GHSA-q87h-c5m7-659j
Otrahttps://github.com/weblyzard/inscriptis/commit/dc122894cd671a0227f8fdad60464acddaf40fc8
Otrahttps://github.com/weblyzard/inscriptis
Otrahttps://github.com/weblyzard/inscriptis/releases/tag/2.7.6

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.