-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
361def1
commit 1e29cc6
Showing
11 changed files
with
190 additions
and
20 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py | ||
index 33c3bf15b..5c293aa7b 100644 | ||
--- a/git/refs/symbolic.py | ||
+++ b/git/refs/symbolic.py | ||
@@ -168,6 +168,8 @@ def _get_ref_info_helper( | ||
"""Return: (str(sha), str(target_ref_path)) if available, the sha the file at | ||
rela_path points to, or None. target_ref_path is the reference we | ||
point to, or None""" | ||
+ if ".." in str(ref_path): | ||
+ raise ValueError(f"Invalid reference '{ref_path}'") | ||
tokens: Union[None, List[str], Tuple[str, str]] = None | ||
repodir = _git_dir(repo, ref_path) | ||
try: | ||
diff --git a/test/test_refs.py b/test/test_refs.py | ||
index 4c421767e..e7526c3b2 100644 | ||
--- a/test/test_refs.py | ||
+++ b/test/test_refs.py | ||
@@ -5,6 +5,7 @@ | ||
# the BSD License: http://www.opensource.org/licenses/bsd-license.php | ||
|
||
from itertools import chain | ||
+from pathlib import Path | ||
|
||
from git import ( | ||
Reference, | ||
@@ -20,9 +21,11 @@ | ||
from git.objects.tag import TagObject | ||
from test.lib import TestBase, with_rw_repo | ||
from git.util import Actor | ||
+from gitdb.exc import BadName | ||
|
||
import git.refs as refs | ||
import os.path as osp | ||
+import tempfile | ||
|
||
|
||
class TestRefs(TestBase): | ||
@@ -616,3 +619,15 @@ def test_dereference_recursive(self): | ||
|
||
def test_reflog(self): | ||
assert isinstance(self.rorepo.heads.master.log(), RefLog) | ||
+ | ||
+ def test_refs_outside_repo(self): | ||
+ # Create a file containing a valid reference outside the repository. Attempting | ||
+ # to access it should raise an exception, due to it containing a parent directory | ||
+ # reference ('..'). This tests for CVE-2023-41040. | ||
+ git_dir = Path(self.rorepo.git_dir) | ||
+ repo_parent_dir = git_dir.parent.parent | ||
+ with tempfile.NamedTemporaryFile(dir=repo_parent_dir) as ref_file: | ||
+ ref_file.write(b"91b464cd624fe22fbf54ea22b85a7e5cca507cfe") | ||
+ ref_file.flush() | ||
+ ref_file_name = Path(ref_file.name).name | ||
+ self.assertRaises(BadName, self.rorepo.commit, f"../../{ref_file_name}") |
1 change: 0 additions & 1 deletion
1
packages/p/python-GitPython/GitPython-3.1.32.1689011721.5d45ce2.tar.xz
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/p/python-GitPython/GitPython-3.1.34.1693646983.2a2ae77.tar.xz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ipfs/bafybeiabl5bf6rk46budxigfezkphhgfatz47gdiplfndykbenfetlwpbm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<services> | ||
<service name="tar_scm" mode="disabled"> | ||
<param name="versionprefix">3.1.32</param> | ||
<service name="tar_scm" mode="manual"> | ||
<param name="versionprefix">3.1.34</param> | ||
<param name="url">https://github.com/gitpython-developers/GitPython</param> | ||
<param name="scm">git</param> | ||
<param name="package-meta">yes</param> | ||
<param name="changesgenerate">enable</param> | ||
<param name="submodules">enable</param> | ||
<param name="revision">3.1.32</param> | ||
<param name="revision">3.1.34</param> | ||
</service> | ||
<service name="recompress" mode="disabled"> | ||
<service name="recompress" mode="manual"> | ||
<param name="compression">xz</param> | ||
<param name="file">*.tar</param> | ||
</service> | ||
<service name="set_version" mode="disabled"/> | ||
<service name="set_version" mode="manual"/> | ||
</services> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters