Skip to content

PIBD: bound segment decoding allocations#3850

Merged
DavidBurkett merged 1 commit into
masterfrom
segment_hardening
Jun 10, 2026
Merged

PIBD: bound segment decoding allocations#3850
DavidBurkett merged 1 commit into
masterfrom
segment_hardening

Conversation

@DavidBurkett

Copy link
Copy Markdown
Member

Cap PMMR segment and segment proof item counts before allocation, and avoid pre-allocating vectors from attacker-controlled counts.

Validate bitmap segment shape before allocation/conversion by rejecting empty blocks, oversized heights/block counts, and offset overflow. Use the fallible bitmap conversion on the P2P receive path so malformed OutputBitmapSegment messages fail cleanly.

Add regression coverage for the oversized segment and malformed bitmap segment cases.

@DavidBurkett DavidBurkett marked this pull request as ready for review June 10, 2026 15:59
@DavidBurkett DavidBurkett merged commit 62e5ace into master Jun 10, 2026
24 checks passed
wiesche89 added a commit that referenced this pull request Jun 11, 2026
* pibd: bound segment decoding allocations (#3850)

* Add fountainoffairfortune seeds

* Clarifies the blinding factor range proof explanation and includes the remaining typo fixes (#3840)

* Bump version to v5.4.1

---------

Co-authored-by: David Burkett <davidburkett38@gmail.com>
wiesche89 added a commit that referenced this pull request Jun 12, 2026
* pibd: bound segment decoding allocations (#3850)

* Add fountainoffairfortune seeds

* Clarifies the blinding factor range proof explanation and includes the remaining typo fixes (#3840)

* Bump version to v5.4.1

* PIBD peers fix (#3823)

* pibd: choose peers based on minimal height, temporary block peers for stale segments disconnecting only outbound, force request for output and rangeproof segments to avoid stuck at this case

* fix: add missing method clear_pibd_requests to commit

* peer: block only non-blocked to not increase times for several requests

* p2p: ignore last connection attempt when there is not enough outbound peers

* pibd: do not check for max cached segments on selecting next desired segment for request

* pibd: check if segment not exists at request when selecting next required

* fix: add segment to request if not exists

* fix: peers iterator to unblock blocked

* peers: keep blocked list into memory till restart or pibd finish

* sync: blocked filter

* lmdb: do not include blocked peers in selection of peer, count also blocked peers to use fallback .zip download

* pibd: increase timeout for .zip fallback

* merge master into staging

---------

Co-authored-by: David Burkett <davidburkett38@gmail.com>
Co-authored-by: ardocrat <ardocrat@gri.mw>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant