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

Aberta
#6,689 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
cpp
Domínio
backend, cli

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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)
Linguagem predominante
C++
Estrelas
26.6k
Forks
1.8k
Merge médio
3d 10h
PRs com merge (30d)
41

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/winget-cli

Todas as issues de microsoft/winget-cli

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.