llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · memtomem-stm

GHSA-7JQX-W58W-8H4P

Quadratic text scans on upstream tool responses let a crafted response stall the proxy event loop

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

Sin parche publicado
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición29 dDesde la divulgación, 22 oct 2026, 5:36 p. m.
Detección29 dDesde 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 (alta) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. No hay versión corregida: aplique mitigaciones.
No es drama, es prevención. Hazme caso.Programa la remediación y duerme tranquilo.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
22 oct 26
21 nov 26
22 oct 26
30 oct 26
6 nov 26
14 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-7JQX-W58W-8H4P divulgada
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

Several scans that memtomem-stm runs over upstream tool-response text re-read the same text from every candidate start whenever a match fails. Their cost is quadratic in the response size, and one of them is cubic. The scans run synchronously on the proxy's event loop, so while one response is being scanned, every other call through the proxy waits.

Under the default configuration (AUTO strategy, cleaning enabled), a response of a few tens of kilobytes can stall the proxy for seconds to minutes. `max_upstream_chars` defaults to 10,000,000, so it does not bound the input in practice.

Severity: High (availability). No data is exposed. The stall ends when the scan finishes. No CVSS vector or CVE is asserted yet.

Affected scans (measured on main `5897eb75`, Python 3.13)

| stage | scan | crafted input | time |
|---|---|---|---|
| COMPRESS (TRUNCATE, picked by AUTO for plain text over budget): truncation note | link count `\[.*?\]\(.*?\)` | 31 KB of `- [](http://` repeated | 153 s (cubic) |
| same | link count | 32 KB of `[` | 2.0 s |
| COMPRESS (TRUNCATE): code-boundary search and list-item count | `(?:^\|\n)\s*…` (`\s*` crosses newlines) | 32 KB of newline-space pairs (survives cleaning) | 3.4 s |
| CLEAN (every response, no budget needed) | HTML tag stripping | 31 KB of `<a ` | 2.8 s |
| CLEAN | link-flood line check (bare URL rule) | one 32 KB line of spaces in a 10+ line paragraph | 0.6 s |
| CLEAN | `<script>`/`<style>` stripping, generic-type protection | `<script>` / `A<` repeated, 32 KB | 0.42 s / 0.17 s |
| PROGRESSIVE content-type detection | `(?:^\|\n)\s*(?:def \|…)` | `\n` repeated, 6 KB | 0.14 s (×4 per doubling) |
| heuristic fact extraction (opt-in, input capped at 20,000 chars) | decision / action-item rules | `\n` repeated, 6 KB | 0.55 s / 1.2 s (×4 per doubling) |

All of these grow quadratically or worse: doubling the input multiplies the time by about four (by about eight for the cubic case).

Prerequisites and reach

  • The default configuration is affected. CLEAN runs on every text response. TRUNCATE is AUTO's choice for plain text over the compression budget.
  • The content must come from an upstream MCP server the operator configured. The realistic attacker is whoever controls content that such an upstream relays (a web page returned by a fetch or browse tool, an issue body, a file in a repository), not the upstream's operator.

Fix

Each scan now runs in linear time and finds the same matches as before. The fix was checked against the old regexes as oracles on seeded random and structured inputs, and against ten mutations. There is one documented behavior change: in TRUNCATE's code-aware output, blank lines before a code boundary now belong to the previous block.

On the crafted inputs above, each consumer now finishes in at most 0.02 s.

Discovery

Found by the post-commit review of the #1212 fix, then widened to every text-path scan by a scaling sweep over the package's regexes.

Versiones

Rangos afectados

Afectada Corregida
memtomem-stm≤ 0.6.5
0.6.5
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
PyPImemtomem-stm
Sin parche — — —
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/memtomem/memtomem-stm/security/advisories/GHSA-7jqx-w58w-8h4p

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