Skip to content

fix: remove unused tar-slip-vulnerable extract_archive dead code - #6671

Merged
bug-ops merged 1 commit into
mainfrom
fix/6467-remove-dead-extract-archive
Jul 28, 2026
Merged

fix: remove unused tar-slip-vulnerable extract_archive dead code#6671
bug-ops merged 1 commit into
mainfrom
fix/6467-remove-dead-extract-archive

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Removes extract_archive from crates/zeph-plugins/src/manager/security.rs — a #[cfg(test)]-gated tar.gz extraction helper with no tar-slip protection (CWE-22) and zero production call sites. All real extraction paths already use the hardened extract_archive_safe, which rejects absolute paths, .. traversal components, and symlink entries.
  • This is dead-code hygiene, not a vulnerability fix — the unsafe function was never reachable outside tests, so there is no live exploit being patched.
  • Migrates the 4 tests that exercised extract_archive onto extract_archive_safe (verified to be a strict superset for all current test fixtures) and drops the now-dead pub(crate) re-export in manager/mod.rs.
  • Rewrites extract_archive_safe's doc comment to remove its now-broken intra-doc link to the deleted function.

Closes #6467

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins (15111 passed, 0 failed)
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • gitleaks protect --staged
  • Repo-wide grep confirms zero remaining extract_archive (non-_safe) references outside the CHANGELOG

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes bug Something isn't working size/M Medium PR (51-200 lines) labels Jul 28, 2026
@bug-ops
bug-ops force-pushed the fix/6467-remove-dead-extract-archive branch from e34b56f to f753073 Compare July 28, 2026 00:40
@bug-ops
bug-ops enabled auto-merge (squash) July 28, 2026 00:40
extract_archive was #[cfg(test)]-gated with zero production call sites;
all real extraction paths already use the hardened extract_archive_safe.
Migrate the 4 tests that exercised extract_archive onto extract_archive_safe
and drop the dead pub(crate) re-export.

Closes #6467
@bug-ops
bug-ops force-pushed the fix/6467-remove-dead-extract-archive branch from f753073 to 0f348dd Compare July 28, 2026 00:50
@bug-ops
bug-ops merged commit 8a32286 into main Jul 28, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6467-remove-dead-extract-archive branch July 28, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Low: tar-slip-vulnerable extract_archive left as unused dead code after #4672 fix

1 participant