Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert - Arbitrary file access during archive extraction ("Zip Slip") #117

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

svrooij
Copy link
Owner

@svrooij svrooij commented Sep 4, 2024

Fixes #116

Fix the arbitrary file access during archive extraction (Zip Slip) vulnerability.

  • src/Winget.CommunityRepository.Ef/WingetRepositoryWithEf.cs

    • Add ExtractToDirectory method to validate file paths during extraction.
    • Update LoadEntriesFromSqlLite method to use the new ExtractToDirectory method.
  • src/WingetIntune/Implementations/DefaultFileManager.cs

    • Add validation for file paths in ExtractFileToFolder method.
    • Update ExtractFileToFolderAsync method to validate file paths during extraction.

For more details, open the Copilot Workspace session.

…tion ("Zip Slip")

Fixes #116

Fix the arbitrary file access during archive extraction (Zip Slip) vulnerability.

* **src/Winget.CommunityRepository.Ef/WingetRepositoryWithEf.cs**
  - Add `ExtractToDirectory` method to validate file paths during extraction.
  - Update `LoadEntriesFromSqlLite` method to use the new `ExtractToDirectory` method.

* **src/WingetIntune/Implementations/DefaultFileManager.cs**
  - Add validation for file paths in `ExtractFileToFolder` method.
  - Update `ExtractFileToFolderAsync` method to validate file paths during extraction.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/svrooij/WingetIntune/issues/116?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

github-actions bot commented Sep 4, 2024

Test Results

28 tests  ±0   28 ✅ ±0   1s ⏱️ ±0s
10 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 5235db3. ± Comparison against base commit 401c934.

@svrooij svrooij merged commit 8f2041a into main Sep 4, 2024
8 checks passed
@svrooij svrooij deleted the fix-zip-slip branch September 4, 2024 16:41
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.

Fix code scanning alert - Arbitrary file access during archive extraction ("Zip Slip")
1 participant