Skip to content

Strip sensitive headers on cross-origin download redirects - #6664

Merged
AmirMS (AmelBawa-msft) merged 4 commits into
microsoft:masterfrom
AmelBawa-msft:user/amelbawa/fix-authenticated-redirects
Nov 11, 2026
Merged

AmirMS (AmelBawa-msft) merged 4 commits into
microsoft:masterfrom
AmelBawa-msft:user/amelbawa/fix-authenticated-redirects

Conversation

@AmelBawa-msft

@AmelBawa-msft AmirMS (AmelBawa-msft) commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Prevent automatic redirects from forwarding sensitive download headers to another origin.

🔗 References

🔍 Validation

✅ Checklist

🤖 AI Assistance

  • AI assistance was used and has been disclosed in this PR
  • No AI assistance was used

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Authenticated installer downloads switch directly to WinINet, bypassing Delivery Optimization’s cost and cellular restrictions that must remain enforced.

1 open issue
What changed in this PR

This PR hardens WinGet downloads by controlling authenticated redirects and stripping sensitive headers when the destination origin changes.

Changes:

  • Adds per-hop redirect handling, HTTPS downgrade protection, and a redirect limit.
  • Routes authenticated installer downloads through WinINet rather than Delivery Optimization.
  • Adds redirect-policy and transport tests, localhost test endpoints, and a release note.
File Description
src/​LocalhostWebServer/​Startup.cs Adds loopback-only redirect and header-check endpoints.
src/​AppInstallerCommonCore/​Public/​AppInstallerDownloader.h Documents sensitive-header redirect behavior.
src/​AppInstallerCommonCore/​Downloader.cpp Implements redirect safeguards and authenticated-download routing.
src/​AppInstallerCommonCore/​DODownloader.cpp Adds a Delivery Optimization test override.
src/​AppInstallerCLITests/​TestHooks.h Exposes redirect-policy and downloader test hooks.
src/​AppInstallerCLITests/​Downloader.cpp Adds policy, transport, and downloader-routing coverage.
doc/​release-notes/​1.31/​authenticated-download-redirects.md Documents the sensitive-header protection.

Review effort: Balanced

@AmelBawa-msft
AmirMS (AmelBawa-msft) merged commit 0d842d4 into microsoft:master Nov 11, 2026
9 checks passed
@AmelBawa-msft
AmirMS (AmelBawa-msft) deleted the user/amelbawa/fix-authenticated-redirects branch November 11, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants