Skip to content

fix: list command returns SecurityViolation for encrypted ZIP (#96)#98

Merged
bug-ops merged 1 commit intomainfrom
fix/bug-list-command-shows-mislead
Mar 15, 2026
Merged

fix: list command returns SecurityViolation for encrypted ZIP (#96)#98
bug-ops merged 1 commit intomainfrom
fix/bug-list-command-shows-mislead

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 15, 2026

Summary

  • list_zip was calling archive.by_index(i) and mapping all errors as InvalidArchive, causing encrypted ZIP archives to produce a misleading "unsupported Zip archive: Password required" message instead of a security violation
  • Applies the same dual-check pattern from the extract path (zip.rs): detect "Password required to decrypt file" in map_err and check entry.encrypted() after a successful open
  • Adds a regression test covering the list path with an encrypted ZIP

Fixes #96.

Test plan

  • cargo nextest run --workspace --all-features --exclude exarch-python --exclude exarch-node --lib --bins — all 519 tests pass
  • New test inspection::list::tests::test_list_zip_encrypted_returns_security_violation passes
  • cargo +nightly fmt --all -- --check — clean
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — clean

@github-actions github-actions bot added core Changes to exarch-core docs Documentation labels Mar 15, 2026
The list path missed the encryption check that was added in #92 for
the extract path. `list_zip` called `archive.by_index(i)` and wrapped
all errors as `InvalidArchive`, so encrypted archives produced a
misleading "unsupported Zip archive: Password required" message.

Apply the same dual-check pattern from `zip.rs`: detect the
"Password required to decrypt file" error string in `map_err` and
check `entry.encrypted()` after a successful open, both returning
`SecurityViolation { reason: "archive is password-protected" }`.

Adds a regression test covering the encrypted ZIP list path.
@bug-ops bug-ops force-pushed the fix/bug-list-command-shows-mislead branch from acba386 to 93ee4a8 Compare March 15, 2026 01:05
@bug-ops bug-ops enabled auto-merge (squash) March 15, 2026 01:05
@bug-ops bug-ops merged commit e1f37d0 into main Mar 15, 2026
20 checks passed
@bug-ops bug-ops deleted the fix/bug-list-command-shows-mislead branch March 15, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to exarch-core docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: list command shows misleading "invalid archive" error for encrypted ZIP (fix #83 incomplete)

1 participant