JGit fetch accepts traversal-shaped remote refs and overwrites a sibling repository ref
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start with the linked sources at the audited revision: org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackConnection.java (where remote-advertised refs are read), RefSpec.java (destination expansion), and RefDirectory.java fileFor (where the ref becomes a filesystem path). Read report.md and attachments.zip first for the protocol walkthrough and reproducer (Maven, Java 17+). Done means a remote ref name containing .. is rejected before it enters the refspec/ref-update path, the sibling victim.git ref stays unchanged, and the reproducer's victim-ref-replaced output becomes false.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
7.8.0.202609011348-r
Operating System
Linux/Unix
Bug description
JGit's fetch client accepts a remote-advertised ref name containing .. and
carries it through the default bare-clone refspec into the file-backed ref
database. The attached server advertises:
refs/heads/../../../victim.git/refs/heads/main
The first bare clone records the logical ref. On a subsequent fetch, the
expanded destination resolves outside the target repository and addresses the
main ref in a sibling victim.git repository.
Actual behavior
The fetch completes successfully and replaces the sibling repository's ref
with the object ID supplied by the remote:
target=target.git
victim-ref=victim.git/refs/heads/main
victim-ref-replaced=true
victim-ref-content=286060ec85628e19c00857f70f34805a115130f7
Expected behavior
The remote ref should be rejected before it enters the local refspec and
file-backed ref update path. The sibling repository's ref should remain
unchanged, and no traversal-shaped ref should be persisted in the target
repository.
Relevant log output
JGit 7.8.0.202609011348-r: victim-ref-replaced=true
JGit 7.9.0-SNAPSHOT (87ec2100): victim-ref-replaced=true
Git core check-ref-format control: rejected
Other information
This gives an untrusted Git server a path traversal into a sibling repository
whenever a JGit client fetches into a filesystem containing other writable
repositories. Repository mirrors, bare caches, build inputs, and server-side
management jobs can have another checkout's branch redirected by a successful
fetch.
The reproducer is a standalone Maven project that uses JGit as both the local
client and test server. It requires Java 17 or newer and Maven 3.8 or newer;
Maven resolves the pinned release dependency. The detailed protocol and
filesystem source analysis is in report.md, and the complete
reproducer and sanitized evidence are in attachments.zip.
Relevant source paths at the audited revision include
BasePackConnection,
RefSpec,
and RefDirectory.fileFor.
Attachments
- Lenguaje dominante
- Java
- Estrellas
- 427
- Forks
- 116
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eclipse-jgit/jgit
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
eclipse-jgit/jgit#329 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
eclipse-jgit/jgit#327 ·
-
Repository.create(boolean bare) should provide a no-arg overload that uses isBare()Quizá libre de nuevo @hardikyadav12 la tomó hace 77 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
eclipse-jgit/jgit#297 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
eclipse-jgit/jgit#293 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-jgit/jgit#288 ·
Todos los issues de eclipse-jgit/jgit
Issues similares
-
? - Needs Triage bot_watch bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA/cudf-spark-jni#5594 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Upgrade solr to 9.11.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DataONEorg/dataone-indexer#390 ·