Skip to content

fix(studio): export only a deck's own data, read as its instance allows - #735

Merged
ixuz merged 1 commit into
mainfrom
fix/export-own-documents
Nov 12, 2026
Merged

ixuz merged 1 commit into
mainfrom
fix/export-own-documents

Conversation

@ixuz

@ixuz ixuz commented Nov 12, 2026

Copy link
Copy Markdown
Member

What and why

The Studio's deck export read a deck's cards and reviews documents with the signed-in user's credentials whenever they were in the user's own storage. That held even for a deck of an instance attached from someone else's pod, and the export then wrote every triple of those documents into the file. Such an instance's catalog may name one of the user's own documents as a deck's, so the file could hold a whole document the user never thought of as part of the deck. Moving or copying cards and copying a deck into a draft already read such a document as no one; export did not.

What changes:

  • exportDeckFile now takes the instance and the WebID. It reads each of the deck's two documents as the user only when the document is in the instance's pod (isInInstancePod), and reads it as no one otherwise, as transferCards does.
  • The archive exports only the deck's own subjects from those documents: its cards with the distractors they name, the review states of those cards, and the blank nodes they lead to. An import already read nothing else, so a file still round-trips.
  • Every caller of the archive now gives it the fetch that reads as no one and says which documents to read that way, so no document is read as the user by default.

The Import & export screen passes the instance and the WebID. docs/data-model.md and docs/studio.md describe the export.

If a deck's document is read as no one and its server refuses access, the export now fails with an error instead of saving a file.

Refs: GHSA-xcjw-3f3x-g9fc

The Studio's deck export read a deck's cards and reviews documents
with the signed-in user's credentials whenever they were in the user's
own storage, even for a deck of an instance attached from someone
else's pod, and then wrote every triple of those documents into the
file. Such an instance's catalog may name a document of the user's own
as a deck's, so the file could hold a whole document the user never
thought of as part of the deck. Moving or copying cards and copying a
deck into a draft already read such a document as no one; export did
not.

exportDeckFile now takes the instance and the WebID, and reads each of
the deck's two documents as the user only when it is in the instance's
pod (isInInstancePod), any other as no one, as transferCards does. The
archive also exports only the deck's own subjects of those documents:
its cards with the distractors they name, and the review states of
those cards, with the blank nodes they lead to. An import already read
nothing else, so a file still round-trips. Every caller of the archive
now gives it the fetch that reads as no one and says which documents
to read with it, so no document is read as the user by default.

Refs: GHSA-xcjw-3f3x-g9fc
@ixuz ixuz added the bug Something isn't working label Nov 12, 2026
@ixuz
ixuz enabled auto-merge November 12, 2026 00:03
@ixuz
ixuz added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 76fd56d Nov 12, 2026
53 checks passed
@ixuz
ixuz deleted the fix/export-own-documents branch November 12, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant