Skip to content

.Net: [Breaking] Harden plugin security defaults for WebFileDownloadPlugin#13644

Open
rogerbarreto wants to merge 6 commits intomicrosoft:mainfrom
rogerbarreto:bugfix/webfiledownload-plugin
Open

.Net: [Breaking] Harden plugin security defaults for WebFileDownloadPlugin#13644
rogerbarreto wants to merge 6 commits intomicrosoft:mainfrom
rogerbarreto:bugfix/webfiledownload-plugin

Conversation

@rogerbarreto
Copy link
Member

Motivation and Context

Improve control and security settings for WebFileDownloadPlugin

  • Change AllowedDomains and AllowedFolders defaults from null (allow-all) to empty (deny-all)
  • Change DisableFileOverwrite default to true
  • Set MaximumDownloadSize default to 10 MB
  • Add path canonicalization via Path.GetFullPath() to prevent directory traversal
  • Switch folder matching from exact to prefix-based with separator handling
  • Fix fileMode variable not being used in FileStream constructor
  • Add XML doc security remarks to all three plugins
  • Update tests for new defaults

…Plugin, and FileIOPlugin

- Change AllowedDomains and AllowedFolders defaults from null (allow-all) to empty (deny-all)
- Change DisableFileOverwrite default to true
- Set MaximumDownloadSize default to 10 MB
- Add path canonicalization via Path.GetFullPath() to prevent directory traversal
- Switch folder matching from exact to prefix-based with separator handling
- Fix fileMode variable not being used in FileStream constructor
- Add XML doc security remarks to all three plugins
- Update tests for new defaults

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rogerbarreto rogerbarreto self-assigned this Mar 10, 2026
@rogerbarreto rogerbarreto requested a review from a team as a code owner March 10, 2026 12:40
rogerbarreto and others added 2 commits March 10, 2026 13:02
…Plugin, and FileIOPlugin

- Change AllowedDomains and AllowedFolders defaults from null (allow-all) to empty (deny-all)
- Change DisableFileOverwrite default to true
- Set MaximumDownloadSize default to 10 MB
- Add path canonicalization via Path.GetFullPath() to prevent directory traversal
- Switch folder matching from exact to prefix-based with separator handling
- Fix fileMode variable not being used in FileStream constructor
- Add XML doc security remarks to all three plugins
- Update tests for new defaults

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rogerbarreto rogerbarreto changed the title .Net: Harden plugin security defaults for WebFileDownloadPlugin .Net: [Breaking] Harden plugin security defaults for WebFileDownloadPlugin Mar 11, 2026
@rogerbarreto rogerbarreto added this pull request to the merge queue Mar 11, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2026
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