Skip to content

Conseal is pre-release. The interface can change between releases.

Threat model: blobs

A blob holds content too large for a record: a random 12-byte IV, then AES-GCM of its bytes under a DEK of its own, with the AAD conseal-sync:v1:<collectionId>:<recordId>:<blobId>. Its DEK travels only in the reference the app puts in the record’s value, so it is sealed under the AEK with the record. The bytes move straight between the device and object storage, through presigned URLs.

  • A fresh DEK per blob, made on the device, and sent nowhere but inside its record’s ciphertext.
  • A blob opens only where it was sealed. The AAD names the collection, the record and the blob id, and the reference gives the size: a blob the server altered, moved from another record or id, or swapped for another of the user’s blobs fails to open, with UnreadableRecordError.
  • No reference before its blob. A sync uploads every blob waiting in a collection before it pushes the collection’s records, and an upload that fails stops the push. A device that pulls a record finds its blobs there, unless they were deleted since.
  • Deletes after the record. A detached blob is deleted from the server only once its record is pushed without the reference.
  • No sign-in sent to storage. FetchSyncTransport sends presigned requests through blobFetch, the global fetch by default, so the app’s sign-in never reaches object storage, and refuses a blob URL for another method than the one it asked for.
  • A presigned URL is a bearer token until it expires. Anyone holding it can fetch or replace that one blob’s ciphertext, which they can’t open. Keep the expiry short.
  • An upload URL is signed for exactly the size the server agreed to, so a client can’t store more than maxBlobBytes through it.
  • The app’s references. The engine finds references by their shape anywhere in a value. The app keeps them in what it saves, and its merge policy decides which survive a merge: one that keeps a reference to a detached blob gets BlobNotFoundError on the other devices, and one that drops a reference leaves the blob on the server until it’s detached or its record deleted.
  • The device’s storage. A blob waiting to upload sits sealed in the RecordStore, with its DEK beside it in the record’s plaintext value. Anything that can read the app’s storage reads it, as it reads the records.
  • The backend’s storage rules. The server presigns each upload for the sealed size it was told; the bucket’s CORS rules, access policies and the lifetime of its URLs are the backend’s.
  • Hide sizes or timing. Uploads happen when the app syncs, and a blob’s size reaches the server unpadded.
  • Cache downloads. openBlob keeps nothing it downloads. Where the app keeps the bytes is the app’s, and so is how it protects them.
  • Collect orphans. Blobs go up before the record that refers to them, so a blob whose record never arrives, or whose reference a merge dropped, stays on the server. It is ciphertext and costs storage, not privacy, and a server may delete blobs whose record never appears.