This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Potential fix for code scanning alert no. 4: Arbitrary file access during archive extraction ("Zip Slip")#6909
Merged
tracyboehrer merged 1 commit intomainfrom Dec 16, 2025
Merged
Conversation
…ring archive extraction ("Zip Slip")
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
tracyboehrer
approved these changes
Dec 16, 2025
Copilot AI
pushed a commit
to rido-min/botbuilder-dotnet
that referenced
this pull request
Dec 17, 2025
…ring archive extraction ("Zip Slip") (microsoft#6909)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
#minor
Potential fix for https://github.com/microsoft/botbuilder-dotnet/security/code-scanning/4
The fix is to ensure that any file path derived from the archive is not able to escape the intended extraction directory. The standard mitigation is to combine the extraction root (
path) with the archive entry’s file name (as currently), then resolve this combined path to an absolute path (resolving traversals/links), and confirm it is still within the extraction root (also resolved to a canonical absolute path). If not, extraction should immediately abort with an exception. This must be done both for files and directory creation.Specifically, in
ExtractZipFolder:Path.Combine(path, entryName), usePath.GetFullPathon it.This change needs to be applied to both branches: directory creation (line 167) and file extraction (line 171).
No additional dependencies are needed, but care needs to be taken to only change the vulnerable region.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.