Skip to content

[audit][medium] Merk chunk-op decoding canonicalizes invalid traversal bytes #704

Description

@QuantumExplorer

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

Summary

ChunkOp::decode maps every byte other than 1 to false for traversal bits.

Impact / failure scenario

Bytes like 2 or 255 are accepted and canonicalized, unlike other traversal decoders that reject non-binary values.

References

  • merk/src/proofs/chunk/chunk_op.rs:101
  • merk/src/proofs/chunk/chunk_op.rs:179
  • merk/src/proofs/chunk/util.rs:327

Suggested fix

Decode traversal bytes with an explicit 0/1 match and reject all other values.

Suggested tests

Update the existing malformed chunk-op test to expect an error for non-binary bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions