Amazon Linux 2022:git (ALAS2022-2022-236)

high Nessus Plugin ID 168588

概要

遠端 Amazon Linux 2022 主機缺少一個安全性更新。

說明

遠端主機上安裝的 git 版本為 2.37.1-1 之前版本。因此,它受到 ALAS2022-2022-236 公告中所提及的多個弱點影響。

- Git for Windows 是一個 Git 分支,其中包含 Windows 專屬修補程式。此弱點會影響在多使用者機器上工作的使用者,其中未受信任的相關方對同一個硬碟具有寫入權限。這些未受信任的相關方可建立資料夾 `C: \.git`,當搜尋 Git 目錄時,本該在存放庫外部執行的 Git 作業將會存取該資料夾。然後,Git 會套用上述 Git 目錄中的任何組態。設定 `GIT_PS1_SHOWDIRTYSTATE` 的 Git Bash 使用者也容易受到影響,因為這些使用者只需啟動 PowerShell 即可安裝 posh-gitare。Visual Studio 等 IDE 使用者容易遭受攻擊的原因是,他們在建立新專案時即會讀取並套用 `C: \.git\config` 中指定的組態。使用 Git 分支的 Microsoft 使用者只要啟動 Git Bash,就會受到影響。此問題已在 Git for Windows 2.35.2 版本中得到修正。針對無法升級的使用者,可採取的因應措施是在執行 Git 命令的所有驅動器上建立資料夾 `.git`,並從這些資料夾移除讀取/寫入存取權。
或者,可以定義或延伸 `GIT_CEILING_DIRECTORIES` 以涵蓋使用者設定檔的 _parent_ 目錄,例如 `C: \Users` (如果使用者設定檔位於 `C: \Users\my-user-name` 中) 。(CVE-2022-24765)

-Git 是一款分散式版本控制系統。 2.37.1、2.36.2、2.35.4、2.34.4、2.33.4、2.32.3、2.31.4 和 2.30.5 版之前的 Git 在所有平台中都容易受到權限提升弱點影響。不知情的使用者仍可能受到 CVE-2022-24765 中報告的問題影響,例如,以 Root 身分瀏覽屬於他們的共用 tmp 目錄時,攻擊者可在該目錄中建立 git 存放庫。 2.37.1、2.36.2、2.35.4、2.34.4、2.33.4、2.32.3、2.31.4 和 2.30.5 版包含針對此問題的修補程式。若要避免受到範例中所述弱點的影響,最簡單的方法是避免以 Root (或 Windows 中的系統管理員) 身分執行 git,並在需要時最大限度地減少其使用。雖然沒有一般性因應措施,但可以移除任何已存在的此類存放庫,並以 Root 身分建立一個存放庫以阻止任何未來的攻擊,以此強化系統,使其免受範例中所述弱點影響。(CVE-2022-29187)

請注意,Nessus 並未測試這些問題,而是僅依據應用程式自我報告的版本號碼作出判斷。

解決方案

執行「yum update git」以更新系統。

另請參閱

https://alas.aws.amazon.com/AL2022/ALAS-2022-236.html

https://alas.aws.amazon.com/cve/html/CVE-2022-24765.html

https://alas.aws.amazon.com/cve/html/CVE-2022-29187.html

Plugin 詳細資訊

嚴重性: High

ID: 168588

檔案名稱: al2022_ALAS2022-2022-236.nasl

版本: 1.3

類型: local

代理程式: unix

已發布: 2022/12/10

已更新: 2023/9/15

支援的感應器: Agentless Assessment, Frictionless Assessment Agent, Frictionless Assessment AWS, Nessus Agent, Nessus

風險資訊

VPR

風險因素: Medium

分數: 6.7

CVSS v2

風險因素: Medium

基本分數: 6.9

時間分數: 5.7

媒介: CVSS2#AV:L/AC:M/Au:N/C:C/I:C/A:C

CVSS 評分資料來源: CVE-2022-29187

CVSS v3

風險因素: High

基本分數: 7.8

時間分數: 7.2

媒介: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

時間媒介: CVSS:3.0/E:F/RL:O/RC:C

弱點資訊

CPE: p-cpe:/a:amazon:linux:git, p-cpe:/a:amazon:linux:git-all, p-cpe:/a:amazon:linux:git-core, p-cpe:/a:amazon:linux:git-core-debuginfo, p-cpe:/a:amazon:linux:git-core-doc, p-cpe:/a:amazon:linux:git-credential-libsecret, p-cpe:/a:amazon:linux:git-credential-libsecret-debuginfo, p-cpe:/a:amazon:linux:git-cvs, p-cpe:/a:amazon:linux:git-daemon, p-cpe:/a:amazon:linux:git-daemon-debuginfo, p-cpe:/a:amazon:linux:git-debuginfo, p-cpe:/a:amazon:linux:git-debugsource, p-cpe:/a:amazon:linux:git-email, p-cpe:/a:amazon:linux:git-gui, p-cpe:/a:amazon:linux:git-instaweb, p-cpe:/a:amazon:linux:git-p4, p-cpe:/a:amazon:linux:git-subtree, p-cpe:/a:amazon:linux:git-svn, p-cpe:/a:amazon:linux:gitk, p-cpe:/a:amazon:linux:gitweb, p-cpe:/a:amazon:linux:perl-git, p-cpe:/a:amazon:linux:perl-git-svn, cpe:/o:amazon:linux:2022

必要的 KB 項目: Host/local_checks_enabled, Host/AmazonLinux/release, Host/AmazonLinux/rpm-list

可被惡意程式利用: true

可輕鬆利用: Exploits are available

修補程式發佈日期: 2022/12/6

弱點發布日期: 2022/4/12

參考資訊

CVE: CVE-2022-24765, CVE-2022-29187