Skip to content

fix(archives): reject normalized destination collisions - #460

Merged
mikamikasuki merged 1 commit into
mikamikasuki:mainfrom
Ehsan-hash:fix/archive-destination-collisions
Oct 27, 2026
Merged

mikamikasuki merged 1 commit into
mikamikasuki:mainfrom
Ehsan-hash:fix/archive-destination-collisions

Conversation

@Ehsan-hash

Copy link
Copy Markdown
Contributor

Project ZIP imports and backup TAR extraction can silently overwrite an earlier file when archive names refer to the same destination. Exact duplicates, dot segments and canonically equivalent Unicode names bypass the existing case-only check.

Expand the shared destination check and use it in both preflights before creating a project or extracting backup members. Keep original names in the error and preserve existing containment, symbolic-link, archive-size and inventory checks.

Validation: reproduced all three ZIP overwrite forms through the real SQLite/API path and the TAR dot-alias overwrite through the actual unpacker. Twelve focused checks and eighteen affected checks pass, including pre-creation rollback, case/traversal/corrupt archives, valid imports and exact SQLite/data byte preservation. A producer-style TAR with directory headers also passes. The original helper/unpacker fails the new regressions.

Full backup create/restore was not verified: the unchanged offline-process guard cannot enumerate host processes under the local sandbox. No guard bypass, broader process permission, PostgreSQL, Docker, live provider or full backend-suite claim.

Fixes #395

@mikamikasuki
mikamikasuki merged commit ef4baae into mikamikasuki:main Oct 27, 2026
1 of 2 checks passed
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.

Reject project archive members that overwrite the same destination path

2 participants