Media

ciguard: SCA HTTP client reads response body without size cap

  • Publicada: 05.05.2026
  • Actualizado: 11.10.2026 14:17

Summary

Both SCA HTTP clients (src/ciguard/analyzer/sca/osv.py and src/ciguard/analyzer/sca/endoflife.py) call payload = json.loads(resp.read().decode('utf-8')) without a maximum-bytes cap. A hostile or compromised endoflife.date / OSV.dev (or a successful TLS MITM) could return a multi-GB response, exhausting the ciguard process's memory.

Threat scenario

ciguard process memory exhaustion → OOM kill or system swap thrash. Realistic when ciguard runs in CI with a limited memory budget (typical: 4-8 GB). No data integrity or confidentiality impact.

Realism caveat: both URLs are hardcoded HTTPS, so this is a low-realism threat (HTTPS prevents MITM unless the attacker controls a trusted CA or hijacks DNS in a way that doesn't trigger cert validation). The unbounded read is structural defence-in-depth, not a directly exploitable bug today.

Patch

  • New MAX_RESPONSE_BYTES = 5 * 1024 * 1024 (5 MB) constant in both modules.
  • body = resp.read(MAX_RESPONSE_BYTES + 1) with overflow check returns None (caller falls back to stale cache).
  • 3 regression tests in tests/test_sca_rules.py::TestSCAResponseSizeCap.

Discovery

Found during ciguard's first self-conducted pentest cycle, 2026-04-26.

CVSS Scoring

  • CVSS v3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L — 3.7 (Low)
  • CVSS v4.0: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N — first.org calc 3.1 (Low); GitHub's calc 6.3 (Medium). Vector is correct — choosing v3.1 as the structured score keeps the consistent Low rating across consumers.

Reproduction

Monkey-patch urllib.request.urlopen to return a fake 50 MB response; observe memory growth before/after the call. Pre-fix: process memory grows by ~50 MB. Post-fix: _fetch returns None, memory growth bounded to MAX_RESPONSE_BYTES.

References

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) ciguard >= 0.6.0, < 0.8.2 0.8.2

Referencias

Puntuación CVSS 3.7/10
Vector CVSS
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Debilidad (CWE)
CWE-770
Plataforma
Python (PyPI)
Paquete
ciguard
Publicada
05.05.2026
Actualizado
11.10.2026 14:17

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-2410 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-xw8c-rrvx-f7xq - CC BY 4.0

Historial de vulnerabilidades: ciguard

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
4
Primera → última
05.2026 05.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Media 1
  • Baja 3

Divulgaciones por año

  1. 2026: 4
  1. Baja · 4.3 ghsa-7ww3-xvf5-cxwm >= 0.1.0, < 0.8.2 0.8.2
  2. Baja · 0.0 CVE-2026-44220 >= 0.8.0, < 0.8.2 0.8.2
  3. Baja · 3.0 CVE-2026-44218 >= 0.1.0, < 0.8.2 0.8.2
  4. ciguard: SCA HTTP client reads response body without size cap esta entrada
    Media · 3.7 CVE-2026-44219 >= 0.6.0, < 0.8.2 0.8.2

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.