fix(backend): enable 7z archives on unix#10434
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces the ChangesCross-platform 7z extraction via sevenz-rust2
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryThis PR migrates 7z handling from the unmaintained
Confidence Score: 5/5Safe to merge — both prior blocking findings are fully addressed by the new sanitize_7z_entry_path function, and the test suite validates all security-relevant cases. The change is well-scoped: a library swap plus the removal of platform guards. sanitize_7z_entry_path correctly handles backslash normalisation, .. traversal, Unix absolute paths, and Windows-prefix paths. The test covers all four attack vectors and the strip-components happy path. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix(backend): reject unsafe 7z entry pat..." | Re-trigger Greptile |
Summary
sevenz-rusttosevenz-rust2.7zextraction and strip-component probing on Unix as well as WindowsWhy
The old
sevenz-rustcrate points to thedyz1990/sevenz-rustGitHub repo, which no longer resolves via GitHub and appears to have been deleted or made private. It is also no longer maintained.sevenz-rust2is the maintained fork/replacement, with the active library repository athasenbanck/sevenz-rust2.ubialready bringssevenz-rust2into the dependency graph.This keeps the direct dependency on
sevenz-rust2 = "0.20"because0.21.0currently requires Rust 1.93 while this crate declaresrust-version = "1.91".Aqua supports
.7zarchives on Unix, so there is no need to keep the Windows-only guard around extraction or autostrip_componentsprobing.Library links
sevenz-rustdyz1990/sevenz-rustsevenz-rust2hasenbanck/sevenz-rust2Validation
mise x cargo -- cargo checkmise x cargo -- cargo test file::tests::test_extract_archive_7z -- --exact --test-threads=1mise x cargo -- cargo fmt --checkNote: a broader
mise x cargo -- cargo test file::testsrun was not useful because Cargo's substring filter also matched unrelatedconfig::env_directive::file::tests; one unrelated global-state panic poisoned later tests.Summary by CodeRabbit
.7zarchives (previously Windows-only)..7zextraction path handling, including backslash-style entry names.strip_componentsbehavior for single-directory archives and made.7zinspection work consistently across platforms..7zis no longer Windows-only..7zinspection, extraction,strip_components, and negative traversal cases.