microsoft / microsoft/winget-cli

Group Policy + admin setting for environment variable expansion in CLI arguments

Open
#6,389 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Relevant area(s)

WinGet CLI

Description of the new feature / enhancement

If we decide to support environment variable expansion in user-supplied CLI arguments (see #6388 and #5551), the capability must be off by default and gated behind an admin setting with a corresponding Group Policy, so IT organizations can control the default/enforced behavior. This issue tracks creating/implementing that Group Policy (and the admin setting it backs).

Context: expanding ambient environment variables in argument values before execution has security implications — an ambient or poisoned environment could redirect an install location or inject installer arguments, which is sharper when winget runs elevated. The capability should therefore be disabled by default and centrally controlled.

This is a sub-issue of #6388 and is contingent on a go/no-go product decision on env-var expansion (tracked with #5551).

Proposed technical implementation details
  • Add an admin setting to enable environment variable expansion for CLI arguments.
  • Add a Group Policy (ADMX + registry) entry so IT can set the default/enforced behavior.
  • Apply consistently across the relevant arguments (--location, --override, --custom, log location, etc.).
  • Perform the expansion centrally during input-argument processing rather than in individual workflow tasks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the go/no-go decision in #5551 and the parent feature in #6388, then trace WinGet CLI input-argument processing. Define the admin setting and its ADMX/registry Group Policy entry, ensuring the behavior is disabled by default and applies consistently to the listed arguments. Done means centrally controlled expansion behavior is implemented for the relevant arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.