diff mbox series

[wrynose,v2,13/27] python3-git: fix CVE-2026-73619

Message ID 20261106144331.3354811-14-yurade@cisco.com
State New
Headers show
Series python3-git: Security fixes | expand

Commit Message

Yogita Urade Nov. 6, 2026, 2:43 p.m. UTC
This patch applies the upstream fix as referenced in [3],
using the commit shown in [1] and [2].

[1] https://github.com/gitpython-developers/GitPython/commit/7a4f5dcb7bf3cbcbf6e438017efcdfe0bc0d36ca
[2] https://github.com/gitpython-developers/GitPython/commit/52199b39ce02c6e8f9fb49e95628b59deebf44c0
[3] https://security-tracker.debian.org/tracker/CVE-2026-73619

Signed-off-by: Yogita Urade <yurade@cisco.com>
---
Changes in v2:
- Changed the advisory reference from NVD to Debian Security Tracker.
  Split the patch into p1 and p2 and updated SRC_URI to apply them in
  order. P1 adds the unsafe clone and archive options; p2 clarifies
  the --bundle-uri risk and its effect on Git’s URI access.
---
 .../python3-git/CVE-2026-73619_p1.patch       | 58 +++++++++++++++++++
 .../python3-git/CVE-2026-73619_p2.patch       | 43 ++++++++++++++
 .../python/python3-git_3.1.43.bb              |  2 +
 3 files changed, 103 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-git/CVE-2026-73619_p1.patch
 create mode 100644 meta/recipes-devtools/python/python3-git/CVE-2026-73619_p2.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-git/CVE-2026-73619_p1.patch b/meta/recipes-devtools/python/python3-git/CVE-2026-73619_p1.patch
new file mode 100644
index 0000000000..0f8541216c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-git/CVE-2026-73619_p1.patch
@@ -0,0 +1,58 @@ 
+From 91f2b27eb8976ef5c663f1a0ea8180e2cf28cb10 Mon Sep 17 00:00:00 2001
+From: "GPT 5.6" <codex@openai.com>
+Date: Sun, 26 Jul 2026 06:00:59 +0200
+Subject: [PATCH] Block unsafe archive additions and bundle URI
+
+GHSA-539m-9xh6-q6rr reports incomplete unsafe option lists for archive inputs
+and clone bundle URLs. Caller-controlled archive additions can expose or inject
+filesystem content, while clone --bundle-uri can dereference an additional
+caller-controlled URL.
+
+Extend the existing archive denylist with --add-file and --add-virtual-file,
+and the clone denylist with --bundle-uri. Regression coverage exercises archive
+kwargs plus both clone multi-option and keyword paths.
+
+Git baseline: a23bace963d508bd96983cc637131392d3face18.
+Documentation/git-archive.adoc defines --add-file/--add-virtual-file, and
+Documentation/git-clone.adoc defines --bundle-uri as fetching from the supplied
+URI.
+
+CVE: CVE-2026-73619
+Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/7a4f5dcb7bf3cbcbf6e438017efcdfe0bc0d36ca]
+
+Backport Changes:
+- Omitted test/test_clone.py, test/test_repo.py because the current PyPI
+  source archive does not include the test suite and the python3-git recipe
+  does not run it.
+
+Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
+(cherry picked from commit 7a4f5dcb7bf3cbcbf6e438017efcdfe0bc0d36ca)
+Signed-off-by: Yogita Urade <yurade@cisco.com>
+---
+ git/repo/base.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/git/repo/base.py b/git/repo/base.py
+index 2776c19e..4b783586 100644
+--- a/git/repo/base.py
++++ b/git/repo/base.py
+@@ -150,6 +150,8 @@ class Repo:
+         "-c",
+         # Can install hooks that execute during clone:
+         "--template",
++        # Fetches from a caller-controlled URL:
++        "--bundle-uri",
+     ]
+     """Options to :manpage:`git-clone(1)` that allow arbitrary commands to be executed.
+
+@@ -171,6 +173,10 @@ class Repo:
+         # Writes output to a caller-controlled filesystem path.
+         "--output",
+         "-o",
++        # Reads from a caller-controlled filesystem path:
++        "--add-file",
++        # Injects a caller-controlled path and contents:
++        "--add-virtual-file",
+     ]
+
+     unsafe_git_revision_options = [
diff --git a/meta/recipes-devtools/python/python3-git/CVE-2026-73619_p2.patch b/meta/recipes-devtools/python/python3-git/CVE-2026-73619_p2.patch
new file mode 100644
index 0000000000..70d28217ec
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-git/CVE-2026-73619_p2.patch
@@ -0,0 +1,43 @@ 
+From 52199b39ce02c6e8f9fb49e95628b59deebf44c0 Mon Sep 17 00:00:00 2001
+From: Byron <sebastian.thiel@icloud.com>
+Date: Sun, 26 Jul 2026 08:56:06 +0200
+Subject: [PATCH] address review comments
+
+CVE: CVE-2026-73619
+Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/52199b39ce02c6e8f9fb49e95628b59deebf44c0]
+
+(cherry picked from commit 52199b39ce02c6e8f9fb49e95628b59deebf44c0)
+Signed-off-by: Yogita Urade <yurade@cisco.com>
+---
+ git/repo/base.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/git/repo/base.py b/git/repo/base.py
+index 93d1725..6594101 100644
+--- a/git/repo/base.py
++++ b/git/repo/base.py
+@@ -150,10 +150,10 @@ class Repo:
+         "-c",
+         # Can install hooks that execute during clone:
+         "--template",
+-        # Fetches from a caller-controlled URL:
++        # Fetches from an additional caller-controlled URI:
+         "--bundle-uri",
+     ]
+-    """Options to :manpage:`git-clone(1)` that allow arbitrary commands to be executed.
++    """Options to :manpage:`git-clone(1)` that permit unsafe command execution or I/O.
+ 
+     The ``--upload-pack``/``-u`` option allows users to execute arbitrary commands
+     directly:
+@@ -165,6 +165,11 @@ class Repo:
+ 
+     The ``--template`` option can install hooks that execute during clone:
+     https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---templatetemplate-directory
++
++    The ``--bundle-uri`` option fetches from an additional URI before fetching from the
++    clone URL. An untrusted value can therefore make Git access local files or
++    unintended network resources:
++    https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---bundle-uriuri
+     """
+     unsafe_git_archive_options = [
+         # Allows arbitrary command execution through the remote git-upload-archive command.
diff --git a/meta/recipes-devtools/python/python3-git_3.1.43.bb b/meta/recipes-devtools/python/python3-git_3.1.43.bb
index d47ce73d72..f0ffb70df8 100644
--- a/meta/recipes-devtools/python/python3-git_3.1.43.bb
+++ b/meta/recipes-devtools/python/python3-git_3.1.43.bb
@@ -34,6 +34,8 @@  SRC_URI += "file://CVE-2026-42284.patch \
            file://CVE-2026-73622.patch \
            file://CVE-2026-73621.patch \
            file://CVE-2026-73620.patch \
+           file://CVE-2026-73619_p1.patch \
+           file://CVE-2026-73619_p2.patch \
            "
 SRC_URI[sha256sum] = "35f314a9f878467f5453cc1fee295c3e18e52f1b99f10f6cf5b1682e968a9e7c"