Skip to content

Bound flat-buffer vector deserialization#24704

Draft
AztecBot wants to merge 1 commit into
nextfrom
cb/bb-audit-remediation-2415-serialize-vector-bounds
Draft

Bound flat-buffer vector deserialization#24704
AztecBot wants to merge 1 commit into
nextfrom
cb/bb-audit-remediation-2415-serialize-vector-bounds

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

Flat-buffer vector deserialization accepted untrusted uint32_t lengths and resized vectors before any bound check. This change adds a shared 64 MiB deserialization budget so oversized byte and generic vector lengths fail before allocation.

Fix

  • Add serialize::MAX_SERIALIZED_VECTOR_BYTES and validate vector sizes by element width before every vector resize.
  • Add regression tests covering raw-buffer and stream reads for byte vectors and generic vectors.

Testing

  • cmake --fresh --preset default
  • cmake --build --preset default --target serialize-tests_tests -j$(nproc)
  • ctest --preset default -R '^(Serialize\.|msgpack_tests\.)' --output-on-failure

Issues

  • Closes AztecProtocol/barretenberg-claude#2415 — bound serialized vector lengths before deserialization allocation.

Created by claudebox · group: bb-audit-remediation

@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant