llamaCVEVulnerability Intelligence
/
Advisory · GitHub

GHSA-MPF5-465H-MR53

gix-pack: reachable panic via unchecked checked_sub().expect() on OFS_DELTA base distance during thin-pack fetch

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
6.5
Media
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición57 dDesde la divulgación, 25 sept 2026, 3:30 a. m.
Detección54 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. No hay versión corregida: aplique mitigaciones.
Si tu inventario está al día, ya ganaste.Riesgo con buenos modales, atiéndela con calma.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
25 sept 26
18 nov 26
21 nov 26
25 sept 26
9 oct 26
23 oct 26
7 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-MPF5-465H-MR53 divulgada · CVSS 6.5 (GitHub)
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
When resolving a thin pack during `fetch`, gix-pack computes an OFS_DELTA base offset with `pack_offset.checked_sub(base_distance).expect("distance to be in range of pack")`. `base_distance` is an unvalidated leb64 varint read directly from the attacker-controlled entry header. A crafted `base_distance` larger than `pack_offset` makes `checked_sub` return `None`, and the `.expect()` panics — a remote denial of service on any `gix`/`gix-pack` fetch into a non-empty repository.

## Root Cause
`LookupRefDeltaObjectsIter::next` (gix-pack/src/data/input/lookup_ref_delta_objects.rs:129-136):

if self.inserted_entries_length_in_bytes != 0 {
    if let Header::OfsDelta { base_distance } = entry.header {
        let base_pack_offset = entry
            .pack_offset
            .checked_sub(base_distance)
            .expect("distance to be in range of pack");

`base_distance` comes from `leb64_from_read` in the entry-header decoder (gix-pack/src/data/entry/decode.rs) with no validation against `pack_offset`. Every sibling conversion guards this — e.g. `index/write/mod.rs:176` uses `verified_base_pack_offset(..).ok_or(Error::…)?`. Only this iterator uses `.expect()`.

## Impact
A malicious remote serving a thin pack triggers `checked_sub` → `None` → `.expect()` panic. The crate is built with `panic = "unwind"` and there is no `catch_unwind` in the gix-pack/gix-protocol/gix runtime read path, so the panic unwinds to the fetch caller, aborting the fetch/process = DoS.

## Proof of Concept
Against a victim repo with at least one referenceable object, serve a thin pack containing (a) a REF_DELTA whose base is an object the victim already holds (so `inserted_entries_length_in_bytes != 0`), followed by (b) an OFS_DELTA entry whose leb64 `base_distance` exceeds its `pack_offset`. The `.expect()` panics.

## Attack Chain
1. Entry: attacker-served upload-pack → victim `fetch` into an existing repo → thin pack. Guard: none.
2. Gate: a REF_DELTA whose `base_id` is an object the victim already has → `self.lookup.try_find` succeeds → `track_change` → `inserted_entries_length_in_bytes != 0`. Guard: `if inserted_entries_length_in_bytes != 0` (line 129). Bypass proof: satisfied by normal thin-pack behaviour; the base exists because the victim has prior history.
3. Sink: a subsequent OFS_DELTA with leb64 `base_distance > pack_offset` → `checked_sub` returns `None` → `.expect(...)` panics (lines 133-136). Guard: should be `.ok_or(Error::…)?` like sibling sites. Bypass proof: no comparison of `base_distance` to `pack_offset` before the `checked_sub`; the varint is read unvalidated.
4. Impact: panic unwinds on the fetch thread → aborts the fetch/process = remote DoS.

## Bypass Evidence
- `git show gix-pack-v0.74.2:gix-pack/src/data/input/lookup_ref_delta_objects.rs` confirms the `.expect()` at lines 133-136 on the latest tag.
- `git log -- gix-pack/src/data/input/lookup_ref_delta_objects.rs` shows no prior DoS-advisory commit touched this file (the GHSA-x494-mj8g-cj27 panic fixes b69f0a6a/5850141e edited only `data/entry/decode.rs`).
- Sibling guarded site confirmed at `index/write/mod.rs:176` (`verified_base_pack_offset(..).ok_or(..)?`).
- Reachability: `receive_pack.rs:184-189` passes `thin_pack_base_object_lookup = Some(...)` → `bundle/write/mod.rs` wraps the stream in `LookupRefDeltaObjectsIter`.

## Affected Versions
`gix-pack <= 0.74.2` (latest release tag gix-pack-v0.74.2; code present on HEAD). No post-tag fix.

## Suggested Fix
Replace `.expect("distance to be in range of pack")` with `.ok_or(Error::...)?`, matching the sibling `verified_base_pack_offset` guard used everywhere else.

## Precondition Note
Does NOT fire on a fresh clone (victim has no objects → REF_DELTA lookup returns None → gate stays false). Fires on a fetch into a repo with ≥1 referenceable object — the normal thin-pack case. Hence severity MEDIUM.

---
Reported by zx (Jace) — GitHub: @manus-use

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:N
NingunoBajosAltos
InteracciónUI:R
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
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.
Remediación

Estado del parche por paquete

La fuente no informa paquetes ni versiones corregidas.

Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/GitoxideLabs/gitoxide/security/advisories/GHSA-mpf5-465h-mr53

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