Repository navigation
Closed
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)Package/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Description
Problem
A write-authorized id-sync peer can attach an archive.rename or archive.replace tag to one file while naming an archive owned by a different file. Deleting the first file then hard-deletes that unrelated archive and its metadata.
Evidence (fresh origin/main 671088b42ce21882f6e40f77288e758847fcaaf6)
pkgs/id/crates/id-sync/src/protocol.rs:691-699gatesSetTagandDeleteon write authorization;:792-800forwards arbitrarySetTagsubject, key, and value toTagStore::set_tagwithout reserving archive-reference keys or checking ownership.pkgs/id/crates/id-store/src/tags.rs:811-847stores the supplied subject/key/value without archive-reference validation.pkgs/id/crates/id-sync/src/fileops.rs:602-615accepts any reference whose value has the general<name>.archive.<digits>shape; it does not require the archive name to belong to the file being deleted.fileops.rs:661-676then deletes each referenced archive tag and all metadata for that archive name.
Reproduction shape
- Create a normal archive for
other-file(for exampleother-file.archive.123) so its tag and metadata exist. - Through
MetaRequest::SetTag, setarchive.replace = "other-file.archive.123"onmy-filefrom a peer granted write access. - Through
MetaRequest::Delete, deletemy-file. - The unrelated archive tag and its metadata are removed, although
other-filewas not renamed or deleted. The archive blob tag is lost and its blob may later be garbage-collected.
This differs from #4761 (now closed), which fixed normal FileOps::copy duplicating internally generated source references. This path allows an authorized protocol client to forge a cross-file ownership reference through the general metadata write endpoint. It is a concrete follow-up to the Rule 3 ownership audit in #4766/#4767.
Acceptance criteria
- Protocol metadata writes cannot create or change an archive ownership reference to an archive not owned by that subject; choose and document an explicit policy for reserved
archive.rename/archive.replacekeys. - Regression test covers a write-authorized peer attempting the cross-file reference, then deleting
my-file;other-file's archive tag and metadata remain intact. - Existing FileOps-generated archive references and legitimate rename/delete behavior continue to work.
- Focused id-sync protocol/FileOps tests pass.
Metadata
Metadata
Assignees
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)Package/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Activity
developing-today commentedon Nov 12, 2026
CODE-2644
dezren39 commentedon Nov 12, 2026
Reproduced on current
main639b961: an authorized peer could set a foreign archive reference, and deleting the subject could remove another file’s archive and metadata. The fix reservesarchive.rename/archive.replacefor FileOps, refuses protocol SetTag/DelTag on those keys, and makes deletion ignore references outside the subject’s own archive namespace. Regression coverage exercises the protocol handler and confirms pre-existing foreign archives survive. PR #8845 is open; focused tests pass, required CI is queued.fix(id-sync): attribute archives across renames via archive.owner bac…