feat: replace SharpCompress with LibArchive.Net#122
Merged
Conversation
SharpCompress 0.47.0 update (PR #121) fails CI due to breaking API changes. Switch to LibArchive.Net which wraps native libarchive, providing broader format support and a simpler API.
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="PACSify/UpdateFetcher.cs">
<violation number="1" location="PACSify/UpdateFetcher.cs:75">
P0: Archive entry paths are used directly for file writes/replacements, which enables path traversal (e.g., `../`) from a crafted TAR and can overwrite arbitrary files.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on e1f44a0..ca2565e
| Severity | Location | Issue | Delete |
|---|---|---|---|
| PACSify/UpdateFetcher.cs:46 | Null reference exception |
✅ Files analyzed, no issues (1)
• PACSify/PACSify.csproj
Use Path.GetFileName() to strip directory components from archive entry names before using them for file operations. A malicious TAR with entries like "../../../etc/crontab" could previously overwrite arbitrary files on the filesystem.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="PACSify/UpdateFetcher.cs">
<violation number="1" location="PACSify/UpdateFetcher.cs:46">
P2: Using `Path.GetFileName(entry.Name)` flattens archive paths and can cause filename collisions/overwrites when different directories contain the same file name.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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
Test plan
High-level PR Summary
This PR replaces the SharpCompress library with LibArchive.Net to resolve breaking API changes that caused issues when updating SharpCompress to version 0.47.0. The change primarily affects the
UpdateFetcherclass, where TAR archive reading logic has been refactored to use the new library's API. LibArchive.Net provides broader format support through native libarchive bindings with bundled binaries for all platforms.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
PACSify/PACSify.csprojPACSify/UpdateFetcher.csSummary by cubic
Switch archive handling to LibArchive.Net in UpdateFetcher to fix CI failures from SharpCompress API changes, improve format support across platforms, and prevent path traversal in archive entries.
Dependencies
Refactors
Written for commit 6949f60. Summary will update on new commits.