Skip to content

Warn before opening downloaded WSL distributions - #41214

Merged
benhillis merged 1 commit into
microsoft:masterfrom
benhillis:benhillis/mark-wsl-files-unsafe
Aug 3, 2026
Merged

Warn before opening downloaded WSL distributions#41214
benhillis merged 1 commit into
microsoft:masterfrom
benhillis:benhillis/mark-wsl-files-unsafe

Conversation

@benhillis

@benhillis benhillis commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • mark the WSLDistributionTar ProgId with FTA_AlwaysUnsafe
  • show the standard Attachment Manager warning before opening internet-zone .wsl files

References

  • FILETYPEATTRIBUTEFLAGS documents FTA_AlwaysUnsafe as 0x00020000 for a ProgId's EditFlags value
  • AssocIsDangerous documents that the Shell checks FTA_AlwaysUnsafe when determining file-type risk and performing zone checks

Testing

  • generated the Visual Studio solution with cmake .
  • completed a full build with cmake --build . -- -m
  • deployed the generated bin\X64\Debug\wsl.msi
  • verified HKCR\WSLDistributionTar\EditFlags is 0x00020000
  • confirmed a .wsl file with ZoneId=3 displays the warning and Cancel prevents it from being opened

Mark the WSLDistributionTar ProgId as always unsafe so Attachment Manager prompts before opening internet-zone .wsl files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 07f017b2-9e33-4595-97ce-0f45c5e4d06f
Copilot AI review requested due to automatic review settings July 30, 2026 23:11
@benhillis
benhillis requested a review from a team as a code owner July 30, 2026 23:11

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.

Pull request overview

This PR updates the MSI packaging to ensure Windows shows the standard Attachment Manager warning dialog when a downloaded (internet-zone) .wsl distribution file is opened, by marking the WSLDistributionTar file type association as “always unsafe”.

Changes:

  • Adds an EditFlags registry value for the WSLDistributionTar ProgId under HKLM\SOFTWARE\Classes to set FTA_AlwaysUnsafe (0x00020000 / 131072).
  • Ensures opening ZoneId=3 .wsl files prompts the user before wsl.exe --install --from-file "%1" is invoked.

@benhillis
benhillis merged commit 873ea3f into microsoft:master Aug 3, 2026
9 checks passed
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.

4 participants