Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Yogita Urade <yurade@cisco.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][wrynose][v2 PATCH 12/27] python3-git: fix CVE-2026-73620
Date: Fri,  6 Nov 2026 06:43:16 -0800	[thread overview]
Message-ID: <20261106144331.3354811-13-yurade@cisco.com> (raw)
In-Reply-To: <20261106144331.3354811-1-yurade@cisco.com>

This patch applies the upstream fix as referenced in [2],
using the commit shown in [1].

[1] https://github.com/gitpython-developers/GitPython/commit/3af0c2516c5e18c829da30338614688f6b69b49c
[2] https://security-tracker.debian.org/tracker/CVE-2026-73620

Signed-off-by: Yogita Urade <yurade@cisco.com>
---
Changes in v2:
- Changed the advisory reference from NVD to Debian Security Tracker.
  Refreshed the embedded hunk context and index hashes.
---
 .../python/python3-git/CVE-2026-73620.patch   | 130 ++++++++++++++++++
 .../python/python3-git_3.1.43.bb              |   1 +
 2 files changed, 131 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-git/CVE-2026-73620.patch

diff --git a/meta/recipes-devtools/python/python3-git/CVE-2026-73620.patch b/meta/recipes-devtools/python/python3-git/CVE-2026-73620.patch
new file mode 100644
index 0000000000..7901c8d28d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-git/CVE-2026-73620.patch
@@ -0,0 +1,130 @@
+From cc80ea13457773907fa7843e274dca8dc7d196a5 Mon Sep 17 00:00:00 2001
+From: "GPT 5.6" <codex@openai.com>
+Date: Sun, 26 Jul 2026 05:54:27 +0200
+Subject: [PATCH] Block unsafe checkout-index and tag file options
+
+GHSA-3f7w-8rr8-f37f reports that caller-controlled options forwarded by
+IndexFile.checkout() and TagReference.create() can make Git write to or read
+from arbitrary filesystem paths.
+
+Add regression coverage proving the unsafe options are rejected by default while
+preserving the explicit allow_unsafe_options escape hatch. Reuse GitPython's
+existing option candidate normalization and unsafe-option guard at both public
+API boundaries.
+
+Git baseline: a23bace963d508bd96983cc637131392d3face18.
+Documentation/git-checkout-index.adoc defines --prefix as prepending an output
+path, and Documentation/git-tag.adoc defines -F/--file as reading a tag message
+from a file.
+
+CVE: CVE-2026-73620
+Upstream-Status: Backport [https://github.com/gitpython-developers/GitPython/commit/3af0c2516c5e18c829da30338614688f6b69b49c]
+
+Backport Changes:
+- Omitted test/test_index.py, test/test_refs.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 3af0c2516c5e18c829da30338614688f6b69b49c)
+Signed-off-by: Yogita Urade <yurade@cisco.com>
+---
+ git/index/base.py | 12 ++++++++++++
+ git/refs/tag.py   | 13 +++++++++++++
+ 2 files changed, 25 insertions(+)
+
+diff --git a/git/index/base.py b/git/index/base.py
+index dfe7e0dc..90d4c16f 100644
+--- a/git/index/base.py
++++ b/git/index/base.py
+@@ -129,6 +129,8 @@ IndexFile
+     Make sure you use :meth:`index.write() <write>` once you are done manipulating the
+     index directly before operating on it using the git command.
+     """
++    unsafe_git_checkout_index_options = ["--prefix"]
++
+ 
+     __slots__ = ("repo", "version", "entries", "_extension_data", "_file_path")
+ 
+@@ -1199,6 +1201,7 @@ IndexFile.checkout
+         paths: Union[None, Iterable[PathLike]] = None,
+         force: bool = False,
+         fprogress: Callable = lambda *args: None,
++        allow_unsafe_options: bool = False,
+         **kwargs: Any,
+     ) -> Union[None, Iterator[PathLike], Sequence[PathLike]]:
+         """Check out the given paths or all files from the version known to the index
+@@ -1224,6 +1227,9 @@ IndexFile.checkout
+             The provided progress information will contain ``None`` as path and item if
+             no explicit paths are given. Otherwise progress information will be send
+             prior and after a file has been checked out.
++        :param allow_unsafe_options:
++            Allow unsafe options, such as ``--prefix``.
++
+ 
+         :param kwargs:
+             Additional arguments to be passed to :manpage:`git-checkout-index(1)`.
+@@ -1248,6 +1254,12 @@ IndexFile.checkout
+             i.e. if you want :manpage:`git-checkout(1)`-like behaviour, use
+             ``head.checkout`` instead of ``index.checkout``.
+         """
++        if not allow_unsafe_options:
++            Git.check_unsafe_options(
++                options=Git._option_candidates([], kwargs),
++                unsafe_options=self.unsafe_git_checkout_index_options,
++            )
++
+         args = ["--index"]
+         if force:
+             args.append("--force")
+diff --git a/git/refs/tag.py b/git/refs/tag.py
+index 1e38663a..487eaa14 100644
+--- a/git/refs/tag.py
++++ b/git/refs/tag.py
+@@ -14,6 +14,7 @@ module imports
+ 
+ # typing ------------------------------------------------------------------
+ 
++from git.cmd import Git
+ from typing import Any, TYPE_CHECKING, Type, Union
+ 
+ from git.types import AnyGitObject, PathLike
+@@ -40,6 +41,8 @@ TagReference
+         print(tagref.tag.message)
+     """
+ 
++    unsafe_git_tag_options = ["--file", "-F"]
++
+     __slots__ = ()
+ 
+     _common_default = "tags"
+@@ -92,6 +95,7 @@ TagReference.create
+         reference: Union[str, "SymbolicReference"] = "HEAD",
+         logmsg: Union[str, None] = None,
+         force: bool = False,
++        allow_unsafe_options: bool = False,
+         **kwargs: Any,
+     ) -> "TagReference":
+         """Create a new tag reference.
+@@ -121,12 +125,21 @@ TagReference.create
+         :param force:
+             If ``True``, force creation of a tag even though that tag already exists.
+ 
++        :param allow_unsafe_options:
++            Allow unsafe options, such as ``--file``.
++
+         :param kwargs:
+             Additional keyword arguments to be passed to :manpage:`git-tag(1)`.
+ 
+         :return:
+             A new :class:`TagReference`.
+         """
++        if not allow_unsafe_options:
++            Git.check_unsafe_options(
++                options=Git._option_candidates([], kwargs),
++                unsafe_options=cls.unsafe_git_tag_options,
++            )
++
+         if "ref" in kwargs and kwargs["ref"]:
+             reference = kwargs["ref"]
+ 
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 f712a0e699..d47ce73d72 100644
--- a/meta/recipes-devtools/python/python3-git_3.1.43.bb
+++ b/meta/recipes-devtools/python/python3-git_3.1.43.bb
@@ -33,6 +33,7 @@ SRC_URI += "file://CVE-2026-42284.patch \
            file://CVE-2026-73624.patch \
            file://CVE-2026-73622.patch \
            file://CVE-2026-73621.patch \
+           file://CVE-2026-73620.patch \
            "
 SRC_URI[sha256sum] = "35f314a9f878467f5453cc1fee295c3e18e52f1b99f10f6cf5b1682e968a9e7c"
 
-- 
2.53.0


  parent reply	other threads:[~2026-11-06 14:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 14:43 [OE-core][wrynose][v2 PATCH 00/27] python3-git: Security fixes Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 01/27] python3-git: fix CVE-2026-67326 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 02/27] python3-git: fix CVE-2026-67323 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 03/27] python3-git: Fix CVE-2026-67325 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 04/27] python3-git: fix CVE-2026-67324 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 05/27] python3-git: fix CVE-2026-67322 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 06/27] python3-git: fix CVE-2026-69097 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 07/27] python3-git: fix CVE-2026-73625 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 08/27] python3-git: fix CVE-2026-73623 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 09/27] python3-git: fix CVE-2026-73624 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 10/27] python3-git: fix CVE-2026-73622 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 11/27] python3-git: fix CVE-2026-73621 Yogita Urade
2026-11-06 14:43 ` Yogita Urade [this message]
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 13/27] python3-git: fix CVE-2026-73619 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 14/27] python3-git: fix CVE-2026-76221 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 15/27] python3-git: fix CVE-2026-76220 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 16/27] python3-git: fix CVE-2026-76219 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 17/27] python3-git: fix CVE-2026-76218 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 18/27] python3-git: fix CVE-2026-76217 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 19/27] python3-git: fix CVE-2026-76222 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 20/27] python3-git: fix CVE-2026-78678 CVE-2026-78679 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 21/27] python3-git: fix CVE-2026-78677 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 22/27] python3-git: fix CVE-2026-78676 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 23/27] python3-git: fix CVE-2026-78675 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 24/27] python3-git: fix CVE-2026-87817 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 25/27] python3-git: fix CVE-2026-87818 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 26/27] python3-git: Fix CVE-2026-87819 Yogita Urade
2026-11-06 14:43 ` [OE-core][wrynose][v2 PATCH 27/27] python3-git: fix CVE-2026-100689 Yogita Urade
2026-11-14  0:16 ` [OE-core][wrynose][v2 PATCH 00/27] python3-git: Security fixes Yoann Congal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261106144331.3354811-13-yurade@cisco.com \
    --to=yurade@cisco.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox