Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877565 (CVE-2022-39253, CVE-2022-39260) - <dev-vcs/git-{2.35.5, 2.37.4, 2.38.1}: Multiple vulnerabilities
Summary: <dev-vcs/git-{2.35.5, 2.37.4, 2.38.1}: Multiple vulnerabilities
Status: RESOLVED FIXED
Alias: CVE-2022-39253, CVE-2022-39260
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Security
URL:
Whiteboard: ?? [glsa+]
Keywords:
Depends on: 877571
Blocks:
  Show dependency tree
 
Reported: 2022-10-18 17:35 UTC by Sam James
Modified: 2024-05-15 09:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-18 17:35:32 UTC
From https://www.openwall.com/lists/oss-security/2022/10/18/5:
"""
The Git project released new versions on 2022-10-18, addressing CVEs
2022-39253, 2022-39260. We highly recommend upgrading to one of the
fixed versions below:

 v2.30.6 v2.31.5 v2.32.4 v2.33.5 v2.34.5 v2.35.5 v2.36.3 v2.37.4 v2.38.1

If you are on the unreleased development track, the same fix is
already included, so you do not have to do anything.

https://lore.kernel.org/git/xmqq4jw1uku5.fsf@gitster.g/T/#u

The relevant information from the most recent release notes
pertaining to the above two CVEs are as follows:

CVE-2022-39253:
  When relying on the `--local` clone optimization, Git dereferences
  symbolic links in the source repository before creating hardlinks
  (or copies) of the dereferenced link in the destination repository.
  This can lead to surprising behavior where arbitrary files are
  present in a repository's `$GIT_DIR` when cloning from a malicious
  repository.

  Git will no longer dereference symbolic links via the `--local`
  clone mechanism, and will instead refuse to clone repositories that
  have symbolic links present in the `$GIT_DIR/objects` directory.

  Additionally, the value of `protocol.file.allow` is changed to be
  "user" by default.

CVE-2022-39260:
  An overly-long command string given to `git shell` can result in
  overflow in `split_cmdline()`, leading to arbitrary heap writes and
  remote code execution when `git shell` is exposed and the directory
  `$HOME/git-shell-commands` exists.

  `git shell` is taught to refuse interactive commands that are
  longer than 4MiB in size. `split_cmdline()` is hardened to reject
  inputs larger than 2GiB.

Credit for finding CVE-2022-39253 goes to Cory Snider of Mirantis. The
fix was authored by Taylor Blau, with help from Johannes Schindelin.

Credit for finding CVE-2022-39260 goes to Kevin Backhouse of GitHub.
The fix was authored by Kevin Backhouse, Jeff King, and Taylor Blau.
"""
Comment 1 Larry the Git Cow gentoo-dev 2022-10-18 17:58:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c16537f9b0375835920b82c9f506456dd3d47f44

commit c16537f9b0375835920b82c9f506456dd3d47f44
Author:     Robin H. Johnson <robbat2@gentoo.org>
AuthorDate: 2022-10-18 17:55:44 +0000
Commit:     Robin H. Johnson <robbat2@gentoo.org>
CommitDate: 2022-10-18 17:57:39 +0000

    dev-vcs/git: bump for security: CVE 2022-39253, CVE 2022-39260
    
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=877565

 dev-vcs/git/Manifest          |   9 +
 dev-vcs/git/git-2.35.5.ebuild | 641 +++++++++++++++++++++++++++++++++++++++++
 dev-vcs/git/git-2.37.4.ebuild | 647 +++++++++++++++++++++++++++++++++++++++++
 dev-vcs/git/git-2.38.1.ebuild | 657 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1954 insertions(+)
Comment 2 Michael Moon 2022-11-30 09:22:41 UTC
Hmm, howcome some of these fixed versions got dropped just now, after being stabilized for over a week?

Nuked the wrong ones by mistake? Seems like 2.35.5 and 2.37.4 should have been kept while 2.37.3 should have been dropped, unless I'm missing something…?

https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-vcs/git?id=e12290707327a6489359e967486570d4b6b0307a
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-30 09:23:37 UTC
(In reply to Michael Moon from comment #2)
> Hmm, howcome some of these fixed versions got dropped just now, after being
> stabilized for over a week?
> 
> Nuked the wrong ones by mistake? Seems like 2.35.5 and 2.37.4 should have
> been kept while 2.37.3 should have been dropped, unless I'm missing
> something…?
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-vcs/
> git?id=e12290707327a6489359e967486570d4b6b0307a

Fixed just a moment ago: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=128f0d0b967059c5564bb96efee2586b84c2f83d
Comment 4 Larry the Git Cow gentoo-dev 2023-12-27 07:49:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/data/glsa.git/commit/?id=2c2ec5453e20060d4ec1717825d2874f0e663f91

commit 2c2ec5453e20060d4ec1717825d2874f0e663f91
Author:     GLSAMaker <glsamaker@gentoo.org>
AuthorDate: 2023-12-27 07:49:08 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2023-12-27 07:49:42 +0000

    [ GLSA 202312-15 ] Git: Multiple Vulnerabilities
    
    Bug: https://bugs.gentoo.org/838127
    Bug: https://bugs.gentoo.org/857831
    Bug: https://bugs.gentoo.org/877565
    Bug: https://bugs.gentoo.org/891221
    Bug: https://bugs.gentoo.org/894472
    Bug: https://bugs.gentoo.org/905088
    Signed-off-by: GLSAMaker <glsamaker@gentoo.org>
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 glsa-202312-15.xml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)