fix(safety): verify in-place writes against full content, not a 4-byte prefix
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start in safety.rs and compare the in-place compression readback check with compress_bytes, focusing on magic_prefix and readback_matches. Trace how the full pre-apply snapshot is created and used; the work is done when both paths verify the complete original content rather than only a four-byte prefix.
Written by the indexing model from the issue text.
Description
The in-place compression path verifies its readback against a 4-byte magic prefix, while compress_bytes compares full content. Any corruption past the first four bytes passes verification.
safety.rs builds a magic_prefix snapshot and checks that on readback. compress_bytes uses readback_matches against a full pre-apply snapshot. The two paths make different guarantees, and the weaker one is the one that mutates a file in place.
A fork of this engine in abitious used the full-content oracle on both paths. That fork is now deleted in favor of depending on this crate, which is why the difference matters: consumers moving onto the published crate get the weaker check.
Suggested fix: use readback_matches against the full pre-apply snapshot on the in-place path too, or document why a prefix check is sufficient there.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SocketDev/decmpfs
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in SocketDev/decmpfs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bcgov/bc-wallet-mobile#4761 · 1 comment ·
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100