Administrator Protection: files of a machine-scope portable package installed elevated are unreadable to the user

オープン
#6,689 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp
領域
backend, cli

調査の方向性

Start in the WinGet CLI install path for portable ZIP packages installed with --scope machine; trace where extraction occurs and how extracted files are moved into the package directory. Reproduce with Administrator Protection enabled and inspect the resulting ACLs against the package root. Done means the installed files inherit the root's Users read and execute permissions, so a normal user can read and run the package.

索引モデルが issue の本文から書いたものです。

説明

Command-Install Issue-Bug Needs-Triage
Relevant area(s)

WinGet CLI

Relevant command(s)

winget install

Brief description of your issue

With Administrator Protection on, an elevated winget runs as the separate account ADMIN_. When it installs a zip package with --scope machine, the extracted files keep the ACL of that account's temp folder instead of inheriting the ACL of C:\Program Files\WinGet\Packages. The normal user then cannot read the files or run the command alias.

Steps to reproduce
  1. Turn on Administrator Protection (TypeOfAdminApprovalMode = 2).
  2. In an elevated terminal: winget install --id ajeetdsouza.zoxide --exact --scope machine --architecture arm64
  3. In a normal terminal: zoxide --version
  4. In the elevated terminal: icacls "C:\Program Files\WinGet\Packages\ajeetdsouza.zoxide_Microsoft.Winget.Source_8wekyb3d8bbwe\zoxide.exe"
Expected behavior

The package files inherit the ACL of the package root, which grants BUILTIN\Users read and execute, so every user can run the package.

Actual behavior

zoxide --version fails with "Access is denied", and the normal user cannot list the package's completions folder. icacls shows only three entries on zoxide.exe:

<PC>\ADMIN_<user>:(I)(F)
BUILTIN\Administrators:(I)(F)
NT AUTHORITY\SYSTEM:(I)(F)

completions and C:\Program Files\WinGet\Links\zoxide.exe have the same three. The package folder itself passes on BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE), so these files did not inherit from it. They look like they were extracted in ADMIN_'s %TEMP% and moved in with that ACL. Without Administrator Protection nobody notices, because the elevated token is the same user.

Environment
Windows Package Manager v1.29.380
Windows: Windows.Desktop v10.0.26300.9974
System Architecture: Arm64
Package: Microsoft.DesktopAppInstaller v1.29.380.0
Administrator Protection: on (TypeOfAdminApprovalMode = 2)
主要言語
C++
スター
26.6k
フォーク
1.8k
平均マージ
3日 10時間
マージ済み PR(30日)
41

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/winget-cli のほかの issue

microsoft/winget-cli の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。