fix: begrens het lezen van beeld-sidecars #542
No reviewers
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck!542
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/beveiligingsharding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The first of the nine items in #516: the unbounded sidecar reads. Partial — #516 stays open.
What was wrong
All three read paths in
ImageSidecarStoreread the file with no size check. A sidecar travels with a deck, so it can arrive from a package, a repository, or somebody else's folder —jsonDecodethen puts a second copy on top of the first.The write path was the sharper one. Without a cap,
write()carried on with an empty map, wrote that over the file, and every other caption in that folder was gone. That is precisely the failure the existingcatchblock next to it describes and defends against — reached by a different route.The cap
1 MiB. The file is a flat map of filename to caption, so that is room for thousands of images. The excess is logged rather than swallowed: silently skipping makes the user believe their captions are gone when they are still on disk.
Verification
Three tests, including that a too-large sidecar is left byte-identical after a write attempt. Mutation-checked: removing the cap makes two of the three fail.
make checkgreen.Still open in #516
The other eight items, of which two deserve a note now:
audienceBoundarygeneric — I measured this before attempting it. There are 208 rawDeck/List<Slide>parameters across 67 files outsideprivacy/, so the obvious inversion ("baseline every Deck-taking function") produces noise rather than signal. A workable generic rule has to key on output — a function that takes a raw deck and reaches an output primitive — which is a real design, not a quick fix. Worth doing, not worth guessing at.assurance/ASVS-5.0.0-afwijkingen.mdwith its reasoning. It should be resolved there if it is resolved, not re-decided in a hardening pass.