Bug 31428 - git new security issues CVE-2022-23521 and CVE-2022-41903
Summary: git new security issues CVE-2022-23521 and CVE-2022-41903
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2023-01-18 19:34 CET by David Walser
Modified: 2023-02-07 01:08 CET (History)
5 users (show)

See Also:
Source RPM: git-2.30.6-1.mga8.src.rpm
CVE:
Status comment:


Attachments

Description David Walser 2023-01-18 19:34:08 CET
Git 2.30.7 has been released on January 17, fixing security issues:
https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes/2.30.7.txt
https://lore.kernel.org/git/xmqqa62g8i6u.fsf@gitster.g/T/
Comment 1 David Walser 2023-01-18 19:35:53 CET
Ubuntu has issued an advisory for this on January 17:
https://ubuntu.com/security/notices/USN-5810-1

Status comment: (none) => Fixed upstream in 2.30.7

Comment 2 David Walser 2023-01-20 17:26:54 CET
(In reply to David Walser from comment #1)
> Ubuntu has issued an advisory for this on January 17:
> https://ubuntu.com/security/notices/USN-5810-1

Regression fix for that update:
https://ubuntu.com/security/notices/USN-5810-2
Comment 3 Nicolas Salguero 2023-01-24 10:39:52 CET
Suggested advisory:
========================

The updated packages fix security vulnerabilities:

Git is distributed revision control system. gitattributes are a mechanism to allow defining attributes for paths. These attributes can be defined by adding a `.gitattributes` file to the repository, which contains a set of file patterns and the attributes that should be set for paths matching this pattern. When parsing gitattributes, multiple integer overflows can occur when there is a huge number of path patterns, a huge number of attributes for a single pattern, or when the declared attribute names are huge. These overflows can be triggered via a crafted `.gitattributes` file that may be part of the commit history. Git silently splits lines longer than 2KB when parsing gitattributes from a file, but not when parsing them from the index. Consequentially, the failure mode depends on whether the file exists in the working tree, the index or both. This integer overflow can result in arbitrary heap reads and writes, which may result in remote code execution. (CVE-2022-23521)

Git is distributed revision control system. `git log` can display commits in an arbitrary format using its `--format` specifiers. This functionality is also exposed to `git archive` via the `export-subst` gitattribute. When processing the padding operators, there is a integer overflow in `pretty.c::format_and_pad_commit()` where a `size_t` is stored improperly as an `int`, and then added as an offset to a `memcpy()`. This overflow can be triggered directly by a user running a command which invokes the commit formatting machinery (e.g., `git log --format=...`). It may also be triggered indirectly through git archive via the export-subst mechanism, which expands format specifiers inside of files within the repository during a git archive. This integer overflow can result in arbitrary heap writes, which may result in arbitrary code execution. (CVE-2022-41903)

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23521
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-41903
https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes/2.30.7.txt
https://lore.kernel.org/git/xmqqa62g8i6u.fsf@gitster.g/T/
https://ubuntu.com/security/notices/USN-5810-1
https://ubuntu.com/security/notices/USN-5810-2
========================

Updated packages in core/updates_testing:
========================
git-2.30.7-1.mga8
git-arch-2.30.7-1.mga8
git-core-2.30.7-1.mga8
git-core-oldies-2.30.7-1.mga8
git-cvs-2.30.7-1.mga8
git-email-2.30.7-1.mga8
git-prompt-2.30.7-1.mga8
git-subtree-2.30.7-1.mga8
git-svn-2.30.7-1.mga8
gitk-2.30.7-1.mga8
gitweb-2.30.7-1.mga8
lib(64)git-devel-2.30.7-1.mga8
perl-Git-2.30.7-1.mga8
perl-Git-SVN-2.30.7-1.mga8

from SRPM:
git-2.30.7-1.mga8.src.rpm

Status: NEW => ASSIGNED
CC: (none) => nicolas.salguero
Status comment: Fixed upstream in 2.30.7 => (none)
Assignee: smelror => qa-bugs

Comment 4 Herman Viaene 2023-01-25 14:15:56 CET
MGA8-64 MATE on Acer Aspire 5253
No installation issues
After removing the previous .git folder from my home, followed procedure as in bug 30985 Comment 6.
$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /home/tester8/.git/
$ git config --global user.name "tester8"
$ git config --global user.email "herman.viaene@hotmail.be"
$ git add ~/Documents/exo.txt
]$ git branch
$ git show
fatal: your current branch 'master' does not have any commits yet
$ git commit
[master (root-commit) a6f38a2] testgit2.30.7
 1 file changed, 1293 insertions(+)
 create mode 100644 Documents/exo.txt
$ git show
commit a6f38a2b56dc95eb1168a4bbe73063124fe48b25 (HEAD -> master)
Author: tester8 <herman.viaene@hotmail.be>
Date:   Wed Jan 25 14:08:32 2023 +0100

    testgit2.30.7

diff --git a/Documents/exo.txt b/Documents/exo.txt
new file mode 100644
index 0000000..3902b92
--- /dev/null
+++ b/Documents/exo.txt
@@ -0,0 +1,1293 @@
+execve("/usr/bin/thunar", ["thunar"], 0x7ffc418dda20 /* 68 vars */) = 0
+brk(NULL)                               = 0xf1e000
+access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
and the further contents of the file....
So OK, good to go.

Whiteboard: (none) => MGA8-64-OK
CC: (none) => herman.viaene

Comment 5 Thomas Andrews 2023-01-25 20:07:13 CET
Validating. Advisory in Comment 3.

Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Dave Hodgins 2023-02-06 22:28:01 CET

Keywords: (none) => advisory
CC: (none) => davidwhodgins

Comment 6 Mageia Robot 2023-02-07 01:08:42 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2023-0033.html

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.