protondrive: correct the memory a full read may hold and note what remains unbounded
The comment and spec put the block metadata a full read holds at a few hundred bytes a block; with realistic tokens and URLs the cap allows about 250-350 MiB, and those fields and API response bodies aren't bounded at all. TODO also asks the live check to confirm the root-of-trust rule on a drive made by Proton's own apps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0cd3af4295
commit
9c90998f76
4 files changed
+19
-4
No files matched your search
@@ -65,8 +65,9 @@ const (
|
||||
// maxFileBlocks is the most blocks a file may list: 2 TiB in
|
||||
// 4 MiB blocks, beyond any one file the largest Proton plan, of a
|
||||
// few TB in all, could hold. A full read holds the metadata of
|
||||
// every block, a few hundred bytes each, until the manifest is
|
||||
// checked, so this bounds that whatever the server claims.
|
||||
// every block until the manifest is checked, so this bounds how
|
||||
// many whatever the server claims: about 250-350 MiB at the cap
|
||||
// with realistic tokens and URLs. Their length isn't bounded.
|
||||
maxFileBlocks = 1 << 19
|
||||
|
||||
// contentKeyFallbackUntil is the Unix time until which a content
|
||||
|
||||
@@ -8,6 +8,17 @@ Small, specific, independently actionable. Remove only when actually done.
|
||||
|
||||
## Next
|
||||
|
||||
- [ ] protondrive: API responses have no body-size limit, and a block
|
||||
list's `Token` and `BareURL` and the first page's `Thumbnails` are
|
||||
unbounded, so the 2^19-block cap bounds how many blocks a full read
|
||||
holds but not the bytes (about 250-350 MiB at the cap with realistic
|
||||
values, unbounded against a hostile server). Consider a limit on API
|
||||
response bodies and on those fields.
|
||||
- [ ] protondrive: in live verification (plan Task 21), confirm on an
|
||||
account whose drive was made by Proton's own apps that the
|
||||
root-of-trust rule passes (the My Files share created, and its root
|
||||
signed, by one of the account's addresses), and count how many folders
|
||||
fail key verification.
|
||||
- [ ] protondrive: a range from offset 0 of a file whose size isn't
|
||||
recorded (`bytes=0-N`, N at or past the end) is read as a ranged read,
|
||||
so its manifest isn't checked; only a known size identifies a range
|
||||
|
||||
@@ -599,6 +599,8 @@ library what must stay readable.
|
||||
(Task 16 fix round 3), and
|
||||
`func (u *User) SetParent(id, parentID string)` (a parent the server
|
||||
reports, cycles included).
|
||||
`func (u *User) ClaimSize(id string, size int64)` (an uploader's
|
||||
wrong size in the extended attributes).
|
||||
- `func (u *User) Dump() []DumpedNode` - decrypted tree for assertions
|
||||
(`ID`, `Path`, `IsFolder`, `Content`, `ModTime`, `SHA1`, `State`, and
|
||||
`Err` joining every decryption, signature, block-hash, manifest and
|
||||
|
||||
@@ -306,8 +306,9 @@ AES-GCM blocks; names, passphrases, hash keys and attributes without AEAD).
|
||||
verify the manifest; this is documented, as it is in the SDK.
|
||||
- A file may list at most 2^19 blocks (2 TiB in 4 MiB blocks, more than
|
||||
any one file a Proton plan can hold), whatever its unsigned size fields
|
||||
claim, which bounds the block metadata a full read holds before the
|
||||
manifest check (a few hundred bytes per block).
|
||||
claim, which bounds how many blocks' metadata a full read holds before
|
||||
the manifest check (about 250-350 MiB at the cap with realistic tokens
|
||||
and URLs; their length, and API response bodies, aren't bounded yet).
|
||||
- A server serving an earlier revision whole (blocks, manifest and
|
||||
extended attributes, all validly signed) under the current revision ID is
|
||||
undetectable: nothing signed binds them to the revision. The SDK cannot
|
||||
|
||||
Reference in new issue
Block a user