Skip to content

[audit][medium] Non-empty tree delete can reopen parent with child tree type #686

@QuantumExplorer

Description

@QuantumExplorer

Created from a Codex audit of grovedb. No code changes were made as part of the audit.

Summary

Direct delete of a non-empty child tree can reopen the parent path using the child tree’s tree_type.

Impact / failure scenario

Deleting under CountTree/sum/count-sum parents with allow_deleting_non_empty_trees=true can propagate aggregate/root metadata incorrectly.

References

  • grovedb/src/operations/delete/mod.rs:740
  • grovedb/src/operations/delete/mod.rs:750
  • grovedb/src/operations/delete/mod.rs:847
  • grovedb/src/operations/delete/mod.rs:880

Suggested fix

Reopen with the parent’s saved tree type or reuse the already-open parent subtree handle.

Suggested tests

Delete a non-empty child under an aggregate parent, then verify aggregate count/sum and verify_grovedb.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions