Mention filename validation and permission handling for ZIP and TAR extraction#54844
Open
rzikm wants to merge 3 commits into
Open
Mention filename validation and permission handling for ZIP and TAR extraction#54844rzikm wants to merge 3 commits into
rzikm wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ZIP/TAR extraction best-practices guidance to address two additional safety considerations: validating archive entry names against an application policy, and handling Unix permission bits that might be restored from archive metadata during extraction.
Changes:
- Added guidance sections for validating entry names and for Unix permission-bit handling during extraction.
- Expanded the Unix permissions discussion with examples showing how to clear/mask permissions prior to extraction.
- Updated the C# snippet sample to include filename-policy validation and permission masking/clearing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docs/standard/io/zip-tar-best-practices.md | Adds new guidance sections, updates the untrusted-archive checklist, and expands Unix permission handling content. |
| docs/standard/io/snippets/zip-tar-best-practices/csharp/Program.cs | Adds a placeholder name-validation function and applies name validation and permission handling in the safe extraction examples. |
gewarren
approved these changes
Jul 21, 2026
gewarren
left a comment
Collaborator
There was a problem hiding this comment.
Left some minor grammar suggestions.
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
alinpahontu2912
approved these changes
Jul 22, 2026
alinpahontu2912
left a comment
Member
There was a problem hiding this comment.
Lgtm, great updates 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce filename validation to ensure extracted entry names conform to acceptable patterns and enhance permission handling for extracted files on Unix systems.
Internal previews