Skip to content

Package download: Validate paths on non-Windows platforms - #55810

Merged
joeloff merged 2 commits into
dotnet:mainfrom
joeloff:downloader
Aug 17, 2026
Merged

joeloff merged 2 commits into
dotnet:mainfrom
joeloff:downloader

Conversation

@joeloff

@joeloff joeloff commented Aug 17, 2026

Copy link
Copy Markdown
Member

Verify paths on non-Windows platforms when extracting files from packages.

Copilot AI lite review requested due to automatic review settings August 17, 2026 18:05
@joeloff
joeloff requested a review from a team as a code owner August 17, 2026 18:05

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 strengthens non-Windows package extraction safety by ensuring file paths derived from package metadata cannot escape the intended extraction directory, and it wires up a new localized CLI string for the resulting error.

Changes:

  • Add a new localized CLI resource string for “resolved path escapes target directory”.
  • Validate resolved paths (non-Windows) before applying Unix file permissions during package extraction.
  • Update the XLF translation files to include the new resource key.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs Adds non-Windows path validation before applying permissions from UnixFilePermissions.xml.
src/Cli/dotnet/CliStrings.resx Adds ResolvedPathEscapesTargetDirectory resource string.
src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.tr.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.ru.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.pl.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.ko.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.ja.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.it.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.fr.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.es.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.de.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).
src/Cli/dotnet/xlf/CliStrings.cs.xlf Adds ResolvedPathEscapesTargetDirectory translation entry (new).

@joeloff
joeloff merged commit 6b7af40 into dotnet:main Aug 17, 2026
21 checks passed
@joeloff

joeloff commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0.1xx-rc1

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0.1xx-rc1 (link to workflow run)

@joeloff

joeloff commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0.1xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0.1xx (link to workflow run)

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — d766a43c Deployed Aug 17, 2026 by joeloff via pre_activation #176
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