Skip to content

Commit 1e29cc6

Browse files
dgarciabmwiedemann
dgarcia
authored andcommitted
Update python-GitPython to version 3.1.34.1693646983.2a2ae77 / rev 29 via SR 1109413
https://build.opensuse.org/request/show/1109413 by user dgarcia + anag+factory - Add CVE-2023-41040.patch to fix directory traversal attack vulnerability gh#gitpython-developers/GitPython#1644 bsc#1214810 - Update _service to use manualrun, disabledrun is deprecated now. - Update to version 3.1.34.1693646983.2a2ae77: * prepare patch release * util: close lockfile after opening successfully * update instructions for how to create a release * prepare for next release * Skip now permanently failing test with note on how to fix it * Don't check form of version number * Add a unit test for CVE-2023-40590 * Fix CVE-2023-40590 * feat: full typing for "progress" parameter * Creating a lock now uses python built-in "open()" method to work around docker virtiofs issue * Disable merge_includes in config writers * Apply straight-forward typing fixes
1 parent 361def1 commit 1e29cc6

11 files changed

+190
-20
lines changed

packages/p/python-GitPython/.files

58 Bytes
Binary file not shown.

packages/p/python-GitPython/.rev

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,4 +834,41 @@
834834
- Switch to pyproject macros.</comment>
835835
<requestid>1104972</requestid>
836836
</revision>
837+
<revision rev="29" vrev="1">
838+
<srcmd5>998017f7aaa9ed8cac6576dc739f3819</srcmd5>
839+
<version>3.1.34.1693646983.2a2ae77</version>
840+
<time>1694113931</time>
841+
<user>anag+factory</user>
842+
<comment>- Add CVE-2023-41040.patch to fix directory traversal attack
843+
vulnerability gh#gitpython-developers/GitPython#1644
844+
bsc#1214810
845+
846+
- Update _service to use manualrun, disabledrun is deprecated now.
847+
- Update to version 3.1.34.1693646983.2a2ae77:
848+
* prepare patch release
849+
* util: close lockfile after opening successfully
850+
* update instructions for how to create a release
851+
* prepare for next release
852+
* Skip now permanently failing test with note on how to fix it
853+
* Don't check form of version number
854+
* Add a unit test for CVE-2023-40590
855+
* Fix CVE-2023-40590
856+
* feat: full typing for &quot;progress&quot; parameter
857+
* Creating a lock now uses python built-in &quot;open()&quot; method to work around docker virtiofs issue
858+
* Disable merge_includes in config writers
859+
* Apply straight-forward typing fixes
860+
* Add missing type annotation
861+
* Run black and exclude submodule
862+
* Allow explicit casting even when slightly redundant
863+
* Ignore remaining [unreachable] type errors
864+
* Define supported version for mypy
865+
* Do not typecheck submodule
866+
* typo
867+
* added more resources section
868+
* generic hash
869+
* redundant code cell
870+
* redundant line
871+
* fixed tabbing</comment>
872+
<requestid>1109413</requestid>
873+
</revision>
837874
</revisionlist>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py
2+
index 33c3bf15b..5c293aa7b 100644
3+
--- a/git/refs/symbolic.py
4+
+++ b/git/refs/symbolic.py
5+
@@ -168,6 +168,8 @@ def _get_ref_info_helper(
6+
"""Return: (str(sha), str(target_ref_path)) if available, the sha the file at
7+
rela_path points to, or None. target_ref_path is the reference we
8+
point to, or None"""
9+
+ if ".." in str(ref_path):
10+
+ raise ValueError(f"Invalid reference '{ref_path}'")
11+
tokens: Union[None, List[str], Tuple[str, str]] = None
12+
repodir = _git_dir(repo, ref_path)
13+
try:
14+
diff --git a/test/test_refs.py b/test/test_refs.py
15+
index 4c421767e..e7526c3b2 100644
16+
--- a/test/test_refs.py
17+
+++ b/test/test_refs.py
18+
@@ -5,6 +5,7 @@
19+
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
20+
21+
from itertools import chain
22+
+from pathlib import Path
23+
24+
from git import (
25+
Reference,
26+
@@ -20,9 +21,11 @@
27+
from git.objects.tag import TagObject
28+
from test.lib import TestBase, with_rw_repo
29+
from git.util import Actor
30+
+from gitdb.exc import BadName
31+
32+
import git.refs as refs
33+
import os.path as osp
34+
+import tempfile
35+
36+
37+
class TestRefs(TestBase):
38+
@@ -616,3 +619,15 @@ def test_dereference_recursive(self):
39+
40+
def test_reflog(self):
41+
assert isinstance(self.rorepo.heads.master.log(), RefLog)
42+
+
43+
+ def test_refs_outside_repo(self):
44+
+ # Create a file containing a valid reference outside the repository. Attempting
45+
+ # to access it should raise an exception, due to it containing a parent directory
46+
+ # reference ('..'). This tests for CVE-2023-41040.
47+
+ git_dir = Path(self.rorepo.git_dir)
48+
+ repo_parent_dir = git_dir.parent.parent
49+
+ with tempfile.NamedTemporaryFile(dir=repo_parent_dir) as ref_file:
50+
+ ref_file.write(b"91b464cd624fe22fbf54ea22b85a7e5cca507cfe")
51+
+ ref_file.flush()
52+
+ ref_file_name = Path(ref_file.name).name
53+
+ self.assertRaises(BadName, self.rorepo.commit, f"../../{ref_file_name}")

packages/p/python-GitPython/GitPython-3.1.32.1689011721.5d45ce2.tar.xz

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/ipfs/bafybeiabl5bf6rk46budxigfezkphhgfatz47gdiplfndykbenfetlwpbm

packages/p/python-GitPython/_service

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<services>
2-
<service name="tar_scm" mode="disabled">
3-
<param name="versionprefix">3.1.32</param>
2+
<service name="tar_scm" mode="manual">
3+
<param name="versionprefix">3.1.34</param>
44
<param name="url">https://github.com/gitpython-developers/GitPython</param>
55
<param name="scm">git</param>
66
<param name="package-meta">yes</param>
77
<param name="changesgenerate">enable</param>
88
<param name="submodules">enable</param>
9-
<param name="revision">3.1.32</param>
9+
<param name="revision">3.1.34</param>
1010
</service>
11-
<service name="recompress" mode="disabled">
11+
<service name="recompress" mode="manual">
1212
<param name="compression">xz</param>
1313
<param name="file">*.tar</param>
1414
</service>
15-
<service name="set_version" mode="disabled"/>
15+
<service name="set_version" mode="manual"/>
1616
</services>

packages/p/python-GitPython/_servicedata

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<param name="url">git://github.com/gitpython-developers/GitPython</param>
44
<param name="changesrevision">f653af66e4c9461579ec44db50e113facf61e2d3</param></service><service name="tar_scm">
55
<param name="url">https://github.com/gitpython-developers/GitPython</param>
6-
<param name="changesrevision">5d45ce243a12669724e969442e6725a894e30fd4</param></service></servicedata>
6+
<param name="changesrevision">2a2ae776825f249a3bb7efd9b08650486226b027</param></service></servicedata>

packages/p/python-GitPython/python-GitPython.changes

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
-------------------------------------------------------------------
2+
Tue Sep 5 08:30:24 UTC 2023 - Daniel Garcia <[email protected]>
3+
4+
- Add CVE-2023-41040.patch to fix directory traversal attack
5+
vulnerability gh#gitpython-developers/GitPython#1644
6+
bsc#1214810
7+
8+
-------------------------------------------------------------------
9+
Tue Sep 05 06:34:12 UTC 2023 - [email protected]
10+
11+
- Update _service to use manualrun, disabledrun is deprecated now.
12+
- Update to version 3.1.34.1693646983.2a2ae77:
13+
* prepare patch release
14+
* util: close lockfile after opening successfully
15+
* update instructions for how to create a release
16+
* prepare for next release
17+
* Skip now permanently failing test with note on how to fix it
18+
* Don't check form of version number
19+
* Add a unit test for CVE-2023-40590
20+
* Fix CVE-2023-40590
21+
* feat: full typing for "progress" parameter
22+
* Creating a lock now uses python built-in "open()" method to work around docker virtiofs issue
23+
* Disable merge_includes in config writers
24+
* Apply straight-forward typing fixes
25+
* Add missing type annotation
26+
* Run black and exclude submodule
27+
* Allow explicit casting even when slightly redundant
28+
* Ignore remaining [unreachable] type errors
29+
* Define supported version for mypy
30+
* Do not typecheck submodule
31+
* typo
32+
* added more resources section
33+
* generic hash
34+
* redundant code cell
35+
* redundant line
36+
* fixed tabbing
37+
* tabbed all code-blocks
38+
* added new section for diffs and formatting
39+
* formatting wip
40+
* change to formatting - removed = bash cmds
41+
* Added new section to print prev file
42+
* WIP major changes to structure to improve readability
43+
* Removed all reference to source code
44+
* Updated generic sha hash
45+
* Added warning about index add
46+
* Made trees and blobs the first section
47+
* refactored print git tree
48+
* clarified comment
49+
* draft of description
50+
* replaced hash with generic
51+
* replaced output cell to generic commit ID
52+
* removed unnecessary variables
53+
* convert from --all flag to all=True
54+
* correct way to get the latest commit tree
55+
* removed try/except and updated sample url
56+
* Updated the sample repo URL
57+
* Made variable names more intuitive
58+
* try to fix CI by making it deal with tags forcefully.
59+
* Removed code from RST
60+
* added quickstart to toctree to fix sphinx warning
61+
* added quickstart to toctree and fixed sphinx warning
62+
* fixed some indentation
63+
* finished code for quickstart
64+
* finished code for quickstart
65+
* Finishing touches for Repo quickstart
66+
* Added git clone & git add
67+
* Made the init repo section of quickdoc
68+
169
-------------------------------------------------------------------
270
Mon Aug 21 04:36:14 UTC 2023 - Steve Kowalik <[email protected]>
371

packages/p/python-GitPython/python-GitPython.spec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@
1717

1818

1919
%define skip_python2 1
20-
%define simple_ver 3.1.32
20+
%define simple_ver 3.1.34
2121
%{?sle15_python_module_pythons}
2222
Name: python-GitPython
23-
Version: 3.1.32.1689011721.5d45ce2
23+
Version: 3.1.34.1693646983.2a2ae77
2424
Release: 0
2525
Summary: Python Git Library
2626
License: BSD-3-Clause
2727
URL: https://github.com/gitpython-developers/GitPython
2828
Source: GitPython-%{version}.tar.xz
2929
Patch0: test-skips.patch
3030
Patch1: test_blocking_lock_file-extra-time.patch
31+
# PATCH-FIX-UPSTREAM CVE-2023-41040.patch gh#gitpython-developers/GitPython#1644
32+
Patch2: CVE-2023-41040.patch
3133
BuildRequires: %{python_module ddt >= 1.1.1}
3234
BuildRequires: %{python_module gitdb >= 4.0.1}
3335
BuildRequires: %{python_module pip}

packages/p/python-GitPython/test-skips.patch

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
test/test_submodule.py | 19 +++++++++++--------
66
4 files changed, 18 insertions(+), 10 deletions(-)
77

8-
--- a/test/test_base.py
9-
+++ b/test/test_base.py
8+
Index: GitPython-3.1.34.1693646983.2a2ae77/test/test_base.py
9+
===================================================================
10+
--- GitPython-3.1.34.1693646983.2a2ae77.orig/test/test_base.py
11+
+++ GitPython-3.1.34.1693646983.2a2ae77/test/test_base.py
1012
@@ -109,7 +109,8 @@ class TestBase(_TestBase):
1113
assert osp.isdir(osp.join(rw_repo.working_tree_dir, "lib"))
1214
assert osp.isdir(rw_repo.working_dir)
@@ -17,8 +19,10 @@
1719
@with_rw_and_rw_remote_repo("0.1.6")
1820
def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo):
1921
assert not rw_repo.config_reader("repository").getboolean("core", "bare")
20-
--- a/test/test_remote.py
21-
+++ b/test/test_remote.py
22+
Index: GitPython-3.1.34.1693646983.2a2ae77/test/test_remote.py
23+
===================================================================
24+
--- GitPython-3.1.34.1693646983.2a2ae77.orig/test/test_remote.py
25+
+++ GitPython-3.1.34.1693646983.2a2ae77/test/test_remote.py
2226
@@ -4,6 +4,7 @@
2327
# This module is part of GitPython and is released under
2428
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
@@ -45,18 +49,22 @@
4549
def test_fetch_error(self):
4650
rem = self.rorepo.remote("origin")
4751
with self.assertRaisesRegex(GitCommandError, "[Cc]ouldn't find remote ref __BAD_REF__"):
48-
--- a/test/test_repo.py
49-
+++ b/test/test_repo.py
52+
Index: GitPython-3.1.34.1693646983.2a2ae77/test/test_repo.py
53+
===================================================================
54+
--- GitPython-3.1.34.1693646983.2a2ae77.orig/test/test_repo.py
55+
+++ GitPython-3.1.34.1693646983.2a2ae77/test/test_repo.py
5056
@@ -250,6 +250,7 @@ class TestRepo(TestBase):
5157
except UnicodeEncodeError:
5258
self.fail("Raised UnicodeEncodeError")
5359

5460
+ @skipIf(os.environ.get('SKIP_GITHUB', 'false') == 'true', 'Gitlab connection error')
5561
@with_rw_directory
62+
@skip("the referenced repository was removed, and one needs to setup a new password controlled repo under the orgs control")
5663
def test_leaking_password_in_clone_logs(self, rw_dir):
57-
password = "fakepassword1234"
58-
--- a/test/test_submodule.py
59-
+++ b/test/test_submodule.py
64+
Index: GitPython-3.1.34.1693646983.2a2ae77/test/test_submodule.py
65+
===================================================================
66+
--- GitPython-3.1.34.1693646983.2a2ae77.orig/test/test_submodule.py
67+
+++ GitPython-3.1.34.1693646983.2a2ae77/test/test_submodule.py
6068
@@ -453,14 +453,15 @@ class TestSubmodule(TestBase):
6169
reason="Cygwin GitPython can't find submodule SHA",
6270
raises=ValueError

packages/p/python-GitPython/test_blocking_lock_file-extra-time.patch

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
test/test_util.py | 4 +---
33
1 file changed, 1 insertion(+), 3 deletions(-)
44

5-
--- a/test/test_util.py
6-
+++ b/test/test_util.py
5+
Index: GitPython-3.1.34.1693646983.2a2ae77/test/test_util.py
6+
===================================================================
7+
--- GitPython-3.1.34.1693646983.2a2ae77.orig/test/test_util.py
8+
+++ GitPython-3.1.34.1693646983.2a2ae77/test/test_util.py
79
@@ -173,9 +173,7 @@ class TestUtils(TestBase):
810
self.assertRaises(IOError, wait_lock._obtain_lock)
911
elapsed = time.time() - start

0 commit comments

Comments
 (0)