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

Đang mở
#6,689 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
backend, cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
C++
Star
26.6k
Fork
1.8k
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
41

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/winget-cli

Tất cả issue của microsoft/winget-cli

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.