CVE-2026-100689
Beschrijving NL
GitPython vóór 3.1.62 valideert het `pad` -veld dat is gelezen uit een niet-vertrouwd .gitmodules-bestand niet bij het bijwerken van submodules. Terwijl een eerdere fix (GHSA-hmq2-w58f-27jc) Submodule._validated_name () heeft toegevoegd om het veld `naam` te beperken, en GitPython's eigen containment guard Submodule._to_relative_path () wordt toegepast in add() en move(), leidt Submodule.update () de absolute afrekenlocatie af van de ruwe `pad` -waarde zonder die guard. Een .gitmodules-ingang met directory-traversal-componenten (bijv. Path = ../../../tmp/escaped) kan er daarom voor zorgen dat mappen worden aangemaakt via os.makedirs () buiten de werkboom van de repository, worden ingevuld vanuit de URL van de submodule op het kloonpad en worden verwijderd via shutil.rmtree () wanneer force_remove wordt gebruikt. Exploitatie vereist een toepassingsstroom die submodules bijwerkt bij een niet-HEAD commit (zoals een historische-commit API); de gemeenschappelijke kloon-dan-update stroom leidt het pad opnieuw af van een canonieke boomopzoeking en wordt niet beïnvloed. Het probleem is opgelost in GitPython 3.1.62.
Origineel (Engels) tonen
GitPython before 3.1.62 does not validate the `path` field read from an untrusted .gitmodules file when updating submodules. While a prior fix (GHSA-hmq2-w58f-27jc) added Submodule._validated_name() to constrain the `name` field, and GitPython's own containment guard Submodule._to_relative_path() is applied in add() and move(), Submodule.update() derives the absolute checkout location from the raw `path` value without that guard. A .gitmodules entry containing directory traversal components (e.g., path = ../../../tmp/escaped) can therefore cause directories to be created via os.makedirs() outside the repository working tree, populated from the submodule URL on the clone path, and removed via shutil.rmtree() when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit (such as a historical-commit API); the common clone-then-update flow re-derives the path from a canonical tree lookup and is not affected. The issue is fixed in GitPython 3.1.62.