-
Notifications
You must be signed in to change notification settings - Fork 27
[audit][medium] Storage removal addition drops default-section removals #683
Copy link
Copy link
Closed
Labels
area:parsing-costsC groups: decoding, storage accounting, cost estimation and serialization.C groups: decoding, storage accounting, cost estimation and serialization.audit:2026-09Reconciled September 2026 GroveDB audit; audited worktree at 2fa0f133.Reconciled September 2026 GroveDB audit; audited worktree at 2fa0f133.audit:needs-validationSaved source evidence reviewed; focused runtime and deployment validation outstanding.Saved source evidence reviewed; focused runtime and deployment validation outstanding.bugSomething isn't workingSomething isn't workingseverity:medium-provisionalMedium impact in the audited scenario; provisional static assessment.Medium impact in the audited scenario; provisional static assessment.type:correctnessAudit reports incorrect library behavior or accounting without proven security impact.Audit reports incorrect library behavior or accounting without proven security impact.
Description
Activity
Metadata
Metadata
Assignees
Labels
area:parsing-costsC groups: decoding, storage accounting, cost estimation and serialization.C groups: decoding, storage accounting, cost estimation and serialization.audit:2026-09Reconciled September 2026 GroveDB audit; audited worktree at 2fa0f133.Reconciled September 2026 GroveDB audit; audited worktree at 2fa0f133.audit:needs-validationSaved source evidence reviewed; focused runtime and deployment validation outstanding.Saved source evidence reviewed; focused runtime and deployment validation outstanding.bugSomething isn't workingSomething isn't workingseverity:medium-provisionalMedium impact in the audited scenario; provisional static assessment.Medium impact in the audited scenario; provisional static assessment.type:correctnessAudit reports incorrect library behavior or accounting without proven security impact.Audit reports incorrect library behavior or accounting without proven security impact.
Created from a Codex audit of grovedb. No code changes were made as part of the audit.
Summary
Combining basic and sectioned storage removals removes/updates the default identifier entry but does not reinsert it.
Impact / failure scenario
Removal bytes from the default identifier can be lost, undercounting storage removals and any costs derived from them.
References
costs/src/storage_cost/removal.rs:83costs/src/storage_cost/removal.rs:102costs/src/storage_cost/removal.rs:148Suggested fix
Reinsert the updated default epoch map before returning or assigning the combined
SectionedStorageRemoval.Suggested tests
Assert
Basic + Sectioned(default),Sectioned(default) + Basic, andAddAssignall preserve both removal amounts.September 2026 audit addendum — C008
Audit group: C008. Classification: correctness. Provisional severity: medium.
The audited mixed Basic/Sectioned removal branches detach and update the default-owner epoch map without reinserting it. This loses existing epoch attribution and incoming basic bytes. The audit also traces KeyValueStorageCost::combined_removed_bytes and final storage accumulation. Sectioned += Basic is already the effective sibling control and must not be regressed. This is the existing #683 defect, not unauthorized credit creation.
Expected contract and correction: Apply the version-selected correction proposed in #726 while preserving legacy V1-V3 results as required. Cover every mixed branch and aggregation order. The PR body reports that callers aggregating outside GroveDB must select the corrected behavior separately; that downstream integration is not independently verified here.
Validation to complete
Limits and existing work
Related tracking: issue #683 (open), PR #726 (open).
Scope: saved GroveDB worktree with revision context
2fa0f133877420a0d9c91ba7bc51b1775ab8c783. This report does not establish that currentdevelopor any deployed application is affected. Focused runtime validation remains outstanding.Audit source and canonical finding identifiers
Source status: snapshot-backed (
git_worktree); plain source locations are used because this is not a sealed commit-only scan.Audited revision context:
2fa0f133877420a0d9c91ba7bc51b1775ab8c783.The findings were manually reconciled from a preserved scan bundle. The native scan ended before final completion; these are provisional source-review findings, not a completed native scan certification.
Canonical finding ID:
csf_d0684b045cb881581559eaaaPrimary fingerprint:
codex-security/v1:sha256:5cac73b5027bfe0390f2ba6beb3ca2b251729abd9efff2e3f012f1a997fe145dSource locations:
costs/src/storage_cost/removal.rs:65-119costs/src/storage_cost/removal.rs:140-183grovedb-epoch-based-storage-flags/src/lib.rs:745-767storage/src/rocksdb_storage/storage.rs:389-404costs/src/storage_cost/removal.rs:76-90costs/src/storage_cost/removal.rs:95-109costs/src/storage_cost/removal.rs:146-160costs/src/storage_cost/key_value_cost.rs:113-116storage/src/rocksdb_storage/storage.rs:398-401