Skip to content

deps(stack): bump bsv-rs from 0.8.10 to 0.8.11 in the bsv-stack group - #50

Merged
github-actions[bot] merged 1 commit into
mainfrom
dependabot/cargo/bsv-stack-aa133230df
Nov 17, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
dependabot/cargo/bsv-stack-aa133230df

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 17, 2026

Copy link
Copy Markdown
Contributor

Bumps the bsv-stack group with 1 update: bsv-rs.

Updates bsv-rs from 0.8.10 to 0.8.11

Release notes

Sourced from bsv-rs's releases.

bsv-rs 0.8.11

A stable patch release of security fixes: the two joining fixes of 0.8.10's program, held back the owner's ~2 days for their final reads and shipped now. Three advisories of this repository are fixed in 0.8.11.

Affected by a published advisory: GHSA-82g9-h6jw-r99f (high, CVSS 7.5), no patched version on its line yet.

Upgrade

cargo update -p bsv-rs. Before upgrading, read the migration block at the head of this version's section of CHANGELOG.md: it lists what a caller does, in order. A service that reads BEEF bytes from a party it does not trust takes the default link bound; a service that must link a large ancestry it trusts opts out with BeefLinkLimits::unbounded.

Advisories

  • Fixes GHSA-gvmh-f5gf-5vjj: Beef::add_input_proof holds a full copy of a shared parent's outputs for every later input that spends it, so an untrusted BEEF within the overlay lookup resolver's 32 MiB response bound forced quadratic heap (an out-of-memory kill, or on wasm32 an abort). Fixed by a default per-link byte budget (16 MiB).
  • Fixes GHSA-cgp9-rj5h-jxw6: HttpRequest::from_payload and HttpResponse::from_payload read a message from the front of a longer payload and dropped the rest, so message || suffix decoded as message. Both now refuse trailing bytes, and the response reader refuses a body shorter than its length prefix.
  • Fixes GHSA-67vc-6c8g-7x48: sighash::parse_transaction read a transaction from the front of a longer buffer and dropped the rest. It now refuses trailing bytes after the transaction.
  • Affected by GHSA-82g9-h6jw-r99f (high, CVSS 7.5): bsv-rs: Transaction::from_ef and from_hex_ef build each input's source outputs by the spent output's index with no bound over the transaction, so a small Extended Format transaction forces an outsized allocation. No patched version on its line yet.

What changed

  • The BEEF linker meters, in absolute bytes, how much the repeat inputs of a shared parent re-materialize and refuses a BEEF past BeefLinkLimits (default Some(16 MiB), closed) before the clone, with Error::BeefResourceLimit — a resource error of its own class, never read as an invalid BEEF or an absent txid. The five doors that read only one output and never the ancestry (the overlay lookup resolver, the kvstore query, the storage downloader, topic discovery, the registry parsers) read the subject alone and link nothing; a service that links several untrusted answers at once bounds its total heap against one pool.
  • The auth HTTP transport's request and response readers refuse any bytes after the message, and the response reader refuses a body shorter than its length prefix, matching the reference's strict reader.
  • sighash::parse_transaction refuses any bytes after the transaction, as the sibling transaction readers already do.

Where

  • main: #1016, ending at 4f5db2f5; beta: #1015, ending at 9e3451f4.
  • Every entry, with what was wrong, the reach, the fix, the tests and the migration: CHANGELOG.md, this version's section.
Changelog

Sourced from bsv-rs's changelog.

[0.8.11] - 2026-11-16

Fixed: linking a BEEF holds one shared parent once per spending input, so an untrusted answer within a resolver's byte bound could force multi-gigabyte heap; a default link bound caps the re-materialization (#749)

  • What was wrong. Beef::add_input_proof (run by Transaction::from_beef, from_atomic_beef and Beef::find_atomic_transaction) links each distinct parent once and hands every later input that spends the same parent a clone of its stub — the parent without its ancestry but with every output. A child whose M inputs each spend one output of a single parent of N outputs therefore holds M copies of all N outputs: the cost grows with the product M×N, not the sum. The lookup resolver parses an overlay host's answer with Transaction::from_beef at intake, before its evidence bounds, and the only pre-parse bound is LookupLimits::max_response_bytes (32 MiB). Because the cost is quadratic in the answer's size, that byte bound sits far above the point where the heap demand exceeds a host's memory — an out-of-memory kill on a native host, an uncatchable abort on wasm32 (Cloudflare Workers, the production target), taking every in-flight request with it. Reachable through the resolver and every other door that parses a stranger's BEEF (identity, kvstore, registry, storage, topic-broadcaster discovery, wallet_retry). This violates rule 5 (every allocation bounded by the input). The 0.3.21 fix made linking linear in the number of transactions; it did not address a single parent of many outputs spent by many inputs, which stayed quadratic.
  • The fix, three parts. (1) The linker moved to the child module src/transaction/beef/link.rs and now meters, in absolute bytes, how much a repeat input re-materializes beyond the answer's own bytes — the wire size of each stub clone — and refuses a BEEF whose re-materialization would exceed BeefLinkLimits, by default BeefLinkLimits::DEFAULT_MAX_LINK_BYTES = Some(16 MiB), before the clone that would allocate past it. A byte budget (not a count of output slots) charges a parent of a few large outputs its true weight, so a sub-megabyte BEEF of few large outputs cannot slip a Worker-OOM re-materialization past the bound. The full links (one per distinct parent) are the BEEF's own bytes and are not counted; only the repeats, the bytes beyond the answer's own, are. Transaction::from_beef / from_atomic_beef / Beef::find_atomic_transaction apply the default (closed); a caller that must link a large ancestry it trusts passes BeefLinkLimits::unbounded through the new Transaction::from_beef_with_limits / from_atomic_beef_with_limits / Beef::find_atomic_transaction_limited. Forced memory becomes a bounded multiple of the bytes the caller already chose to read (measured: a declined link at the 16 MiB default peaks at ~37 MiB, within a 128 MB Worker with room to spare). A refusal is a resource error of its own class, Error::BeefResourceLimit. Which doors surface it: every door that returns Result — Transaction::from_beef / from_beef_with_limits / from_beef_with_budget, from_atomic_beef / from_atomic_beef_with_limits, and Beef::find_atomic_transaction_limited / find_atomic_transaction_with_budget — answers Err(BeefResourceLimit) on a budget trip, never read as an invalid BEEF or an absent txid. The one older convenience that returns an Option, Beef::find_atomic_transaction, cannot carry the error without a signature break the patch line forbids, so a budget trip there still yields None (as an absent txid does); the additive Beef::find_atomic_transaction_limited beside it returns the error, to tell the two apart. (2) The overlay lookup resolver, and the three sibling doors that read only one output and never its ancestry — the kvstore overlay query, the storage UHRP downloader and topic-broadcaster discovery — now read the subject alone through the new Transaction::from_beef_subject (parse without linking the ancestry they do not use), so they link nothing on an untrusted answer: no #749 re-materialization is reachable at any of these doors, and an honest high-fan answer is no longer dropped there for a budget it never had to meet. (On this release the registry definition resolves read no operator-signed definition at all — their output-parse door was removed by this release's authentication refactor, GHSA-w6jf-m9c7-6599 — so there is no linking door to change there.) (3) A caller that links several untrusted answers AT THE SAME TIME (k concurrent from_beef calls) got k independent default budgets, so its peak heap grew with k — two near-budget concurrent links could exceed a 128 MB Worker. The new BeefLinkBudget (one value, three forms: per_link the default, shared(total_bytes), and unbounded) passed to the new Transaction::from_beef_with_budget caps the TOTAL bytes every link sharing one handle may re-materialize at once, against a single pool; the result is a LinkedTransaction that returns its share to the pool when dropped, so the peak is bounded by the pool no matter the concurrency (measured: k = 2/3/5 retained links peak at 41/59/95 MiB with independent budgets, 41/57/57 MiB flat with a 24 MiB shared pool).
  • 0 honest refusals. At the 16 MiB default an honest same-parent full-sweep consolidation is refused only beyond 1,294 swept outputs (8/16/32 MiB: 914 / 1,294 / 1,830); the largest shared-parent fan in any dependent's real BEEF is 20, so the default leaves generous single-link headroom above anything a wallet or the overlay engine builds. The dependents' real fixtures (overlay-cloudflare JOIN, zanaadu proven-head, the 15- and 58-transaction hop-ledger letters) all link by default; the crate's own BEEF suite (the diamond_beef(24) change chain, the deep and wide chains) is green under the default.
  • What pins it. tests/beef_link_bound.rs: a shared parent of large outputs is refused by the default from_beef with Error::BeefResourceLimit (RED before this fix, which linked it unbounded), while an honest 200- and 500-output full-sweep consolidation — which a count-of-slots bound refuses — links by default; the default BeefLinkLimits::DEFAULT_MAX_LINK_BYTES is pinned to 16 MiB with its single-link headroom (a change to the value or the headroom is RED); the refusal is told apart from an absent txid and a malformed BEEF; the resolver's from_beef_subject door links nothing on the same answer; BeefLinkLimits::unbounded opts out; BeefLinkBudget has three forms and a shared pool caps k concurrent links, refusing the overdraw with the named error before it allocates and refilling on release. tests/beef_link_doors.rs: each output-only door (the resolver's SLAP parse, kvstore query, the storage downloader on a signed advertisement, topic discovery) surfaces an answer whose ancestry the linking door refuses — RED if the door reverts to from_beef (demonstrated: reverting each door drops the answer); the registry resolve, which reads no operator-signed definition on this release, is pinned to link nothing on that shape. tests/memory_profiling.rs (dhat-profiling) pins the refuse-before-the-allocation order (the declined link's peak heap is RED if the clone is moved before the budget check) and measures the shared pool holding k = 2/3/5 concurrent links flat where independent budgets grow.
  • The fix, three parts. (1) The linker moved to the child module src/transaction/beef/link.rs and now meters, in absolute bytes, how much a repeat input re-materializes beyond the answer's own bytes — the wire size of each stub clone — and refuses a BEEF whose re-materialization would exceed BeefLinkLimits, by default BeefLinkLimits::DEFAULT_MAX_LINK_BYTES = Some(16 MiB), before the clone that would allocate past it. A byte budget (not a count of output slots) charges a parent of a few large outputs its true weight, so a sub-megabyte BEEF of few large outputs cannot slip a Worker-OOM re-materialization past the bound. The full links (one per distinct parent) are the BEEF's own bytes and are not counted; only the repeats, the bytes beyond the answer's own, are. Transaction::from_beef / from_atomic_beef / Beef::find_atomic_transaction apply the default (closed); a caller that must link a large ancestry it trusts passes BeefLinkLimits::unbounded through the new Transaction::from_beef_with_limits / from_atomic_beef_with_limits / Beef::find_atomic_transaction_limited. Forced memory becomes a bounded multiple of the bytes the caller already chose to read (measured: a declined link at the 16 MiB default peaks at ~37 MiB, within a 128 MB Worker with room to spare). A refusal is a resource error of its own class, Error::BeefResourceLimit. Which doors surface it: every door that returns Result — Transaction::from_beef / from_beef_with_limits / from_beef_with_budget, from_atomic_beef / from_atomic_beef_with_limits, and Beef::find_atomic_transaction_limited / find_atomic_transaction_with_budget — answers Err(BeefResourceLimit) on a budget trip, never read as an invalid BEEF or an absent txid. The one older convenience that returns an Option, Beef::find_atomic_transaction, cannot carry the error without a signature break the patch line forbids, so a budget trip there still yields None (as an absent txid does); the additive Beef::find_atomic_transaction_limited beside it returns the error, to tell the two apart. (2) The overlay lookup resolver, and the four sibling doors that read only one output and never its ancestry — the kvstore overlay query, the storage UHRP downloader, topic-broadcaster discovery and the registry definition parsers — now read the subject alone through the new Transaction::from_beef_subject (parse without linking the ancestry they do not use), so they link nothing on an untrusted answer: no #749 re-materialization is reachable at any of these doors, and an honest high-fan answer is no longer dropped there for a budget it never had to meet. (3) A caller that links several untrusted answers AT THE SAME TIME (k concurrent from_beef calls) got k independent default budgets, so its peak heap grew with k — two near-budget concurrent links could exceed a 128 MB Worker. The new BeefLinkBudget (one value, three forms: per_link the default, shared(total_bytes), and unbounded) passed to the new Transaction::from_beef_with_budget caps the TOTAL bytes every link sharing one handle may re-materialize at once, against a single pool; the result is a LinkedTransaction that returns its share to the pool when dropped, so the peak is bounded by the pool no matter the concurrency (measured: k = 2/3/5 retained links peak at 41/59/95 MiB with independent budgets, 41/57/57 MiB flat with a 24 MiB shared pool). Size a shared pool so its worst-case peak, ≈ 2 × pool + baseline, fits the host: a 32 MiB pool peaks at ~94 MiB on a 128 MB Worker (~30 MiB baseline), bounded regardless of concurrency (fold3 ruling 3).
  • 0 honest refusals. The default's honest reach is stated by output size, not one general figure — the onset of an honest same-parent single-child sweep falls as the output grows, so no single number reads as the general case. At the 16 MiB default an honest child can sweep up to 702 plain-payment (P2PKH) outputs of one parent, 251 data-carrying outputs of 256 B, or 127 of 1 KiB, before one such sweep is refused (at 32 MiB: 993 / 354 / 180; measured by this crate's own writer, fold3 ruling 4). The largest shared-parent fan in any dependent's real BEEF is 20, so the default leaves generous single-link headroom above anything a wallet or the overlay engine builds. The dependents' real fixtures (overlay-cloudflare JOIN, zanaadu proven-head, the 15- and 58-transaction hop-ledger letters) all link by default; the crate's own BEEF suite (the diamond_beef(24) change chain, the deep and wide chains) is green under the default.
  • What pins it. tests/beef_link_bound.rs: a shared parent of large outputs is refused by the default from_beef with Error::BeefResourceLimit (RED before this fix, which linked it unbounded), while an honest 200- and 500-output full-sweep consolidation — which a count-of-slots bound refuses — links by default; the default BeefLinkLimits::DEFAULT_MAX_LINK_BYTES is pinned to 16 MiB with its single-link headroom, and the_default_headroom_is_stated_per_output_size fixes the per-output-size cells exactly (16 MiB: 702 / 251 / 127; 32 MiB: 993 / 354 / 180), so a change to the value or to any cell is RED; the refusal is told apart from an absent txid and a malformed BEEF; the resolver's from_beef_subject door links nothing on the same answer; BeefLinkLimits::unbounded opts out; BeefLinkBudget has three forms and a shared pool caps k concurrent links, refusing the overdraw with the named error before it allocates and refilling on release. tests/beef_link_doors.rs: each output-only door (the resolver's SLAP parse, kvstore query, storage downloader, topic discovery, registry basket) surfaces an answer whose ancestry the linking door refuses — RED if the door reverts to from_beef (demonstrated: reverting each door drops the answer); the kvstore query door carries a behavioural guard driving the real door end to end beside its parser-boundary pin (fold3 ruling 1). tests/beef_link_refuse_order.rs pins the refuse-before-the-allocation order in the NORMAL gate (a counting allocator, no dhat-profiling): a refused link's cumulative allocation is RED if the clone is moved before the budget check. tests/memory_profiling.rs (dhat-profiling) pins the same order by heap peak and measures the shared pool holding k = 2/3/5 concurrent links flat where independent budgets grow.
  • Migration. Additive, a true patch. The new entry points (from_beef_with_limits / from_atomic_beef_with_limits / from_beef_subject / from_beef_with_budget, find_atomic_transaction_limited / find_atomic_transaction_with_budget), the new types BeefLinkLimits / BeefLinkBudget / LinkedTransaction, the BeefLinkLimits::DEFAULT_MAX_LINK_BYTES constant, and the new Error::BeefResourceLimit variant (behind the non-exhaustive Error enum, transaction-gated) are all additions; no public struct gains a field, no existing signature changes, no public item is removed or reshaped and no existing error text changes (cargo semver-checks 0.51.0 --release-type patch: clean). A caller who links only honest BEEFs sees no change (the 16 MiB default refuses none of them). A caller who deliberately links a huge shared-parent BEEF it trusts opts out with BeefLinkLimits::unbounded; a service that links many untrusted answers at once caps its total heap with BeefLinkBudget::shared through from_beef_with_budget.

Notes: cross-SDK parity (#749)

The reference @bsv/sdk keeps one Transaction object per txid and assigns it to every spending input by reference, so it does not amplify a shared parent and has no twin of this bound; go-sdk likewise shares the object. This crate owns source_transaction as a Box per input, so it cannot share the object and instead caps the re-materialization in absolute bytes. By default this crate therefore refuses a pathological shared-parent BEEF that the reference would link (sharing the object cheaply); a caller that trusts such an input restores the reference's behaviour with BeefLinkLimits::unbounded. The honest wire is unchanged. Added to the root CLAUDE.md divergence list.

Security: primitives::bsv::sighash::parse_transaction read a transaction from the front of a longer buffer and dropped the rest; it now refuses the trailing bytes (bsv-rs #843, advisory pending)

  • What was wrong. parse_transaction(&[u8]) (src/primitives/bsv/sighash.rs) read version, inputs, outputs and locktime from the front of the buffer and returned Ok without checking that the buffer was consumed: a transaction || any_suffix buffer read as the prefix transaction, the suffix silently dropped. Every published version reads this way.
  • The reach. In-crate every caller passes exact transaction bytes (BeefTx::raw_tx, Transaction::to_binary, the spending transaction's raw bytes); the overlay dependent reaches it with spender/refund bytes that can originate from a peer. The sighash is computed over the parsed prefix and the dropped suffix lies outside every signature, so no verdict flips and an attacker gains nothing from the ignored bytes; bounded, no panic — a robustness defect with a benign outside path.
  • The fix. After the locktime, the reader refuses a non-empty remainder: Error::CryptoError("trailing bytes after transaction: N byte(s) remain"), as the sibling transaction readers refuse trailing bytes. The reference has no twin door — the TypeScript and Go SDKs build the sighash preimage from an already-parsed transaction — so refusing the trailing bytes aligns with it. The module sits at its code-health ceiling, so the guard's lines are recovered from the function's redundant non-compiled doc example, meaning unchanged.
  • The tests. tests/sighash_parse_transaction_trailing_843.rs (2): an exact transaction (built by the crate's own writer) parses; the same transaction with one trailing byte is refused. RED on the pre-fix door, green on the fix.
  • Migration. A caller that passed a buffer with bytes after the transaction now gets an Err where it got the prefix transaction. Every in-crate caller passes exact bytes (replayed through the door: refused 0). There is no workaround.

Security: the auth HTTP transport's wire readers read a request or a response from the front of a longer payload and dropped the rest; both now refuse the trailing bytes, as the reference SDK does (bsv-rs #843, advisory pending)

  • What was wrong. HttpRequest::from_payload and HttpResponse::from_payload (the BRC-104 General-message wire, src/auth/transports/http.rs) read their fields from the front of the payload and returned Ok without checking that the cursor reached the end: a message || any_suffix payload read as message, the suffix silently dropped. Every published version reads this way.
  • The reach. A peer supplies the request payload on a server built on the crate; a server supplies the response payload on the client (the toolbox dependent calls HttpResponse::from_payload on a storage server's response). The BRC-103 signature is verified over the raw payload bytes, not over from_payload's output, so appending trailing bytes to a signed message breaks the signature and is caught; the gap is on field extraction and the unsigned general-message path — a malleability/robustness defect, not a verdict bypass. No panic, no unbounded cost (the reads are already bounded).
  • The fix. After the final (body) field, both readers advance the cursor through the body and refuse any remaining bytes: Error::AuthError("Authenticated request contains trailing bytes") / Error::AuthError("Authenticated response contains trailing bytes."), matching the reference's SimplifiedFetchTransport and AuthFetch's StrictResponseReader.assertFinished (ts-stack b3155fa2, 2026-09-22). The response reader also refuses a body shorter than its length prefix — an over-claimed body-length prefix once let the lenient short-body branch swallow a suffix and slip the trailing-bytes check — Error::AuthError("Response payload too short for body"), as the request reader already did and as the reference's StrictResponseReader (readExact/#requireBytes, AuthFetch.ts:1289) does. The module sits at its code-health ceiling, so the guards' lines are recovered from redundant inline field comments and a duplicated format doc, meaning unchanged. No signature moved.
  • The tests. tests/auth_http_trailing_bytes_843.rs (6): an exact request and an exact response decode; a request, a response and an empty-body response each refuse a trailing byte, driven one byte AND many (a refusal that fired only for a single extra byte is caught by the many case); and a response whose body-length prefix over-claims is refused rather than swallowing the suffix. RED on the pre-fix doors (the extra byte was accepted) and on the pre-fold lenient short-body branch, green on the fix.
  • Migration. A caller that passed a payload with bytes after the message now gets an Err where it got the prefix message. Every caller in this crate and in the dependents passes an exact serialized payload (replayed through the doors: refused 0). There is no workaround.
Commits
  • 91d0711 0.8.11: a security patch on the stable line (3 advisories)
  • 4f5db2f ci(secrets): allow the published advisory id GHSA-w6jf-m9c7-6599 in the CHANG...
  • 767e4f4 docs(CHANGELOG.md): move the 0.8.11 entries under [Unreleased]
  • c2d7af9 auth: HttpResponse::from_payload refuses a body shorter than its length prefi...
  • 1890c79 primitives(sighash): parse_transaction refuses trailing bytes after the trans...
  • 2e3207b auth: HttpRequest/HttpResponse::from_payload refuse trailing bytes after the ...
  • a010fff transaction: #749 fold4 — the documents job green and the refuse-before-alloc...
  • 04f7617 transaction: #749 fold3 — behavioural guards on the output-only doors, a norm...
  • e2b020d transaction: #749 fold2 — the output-only overlay doors link nothing, a share...
  • 7a88314 transaction: the #749 link bound is an absolute byte budget with a named reso...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

Bumps the bsv-stack group with 1 update: [bsv-rs](https://github.com/Calhooon/bsv-rs).


Updates `bsv-rs` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/Calhooon/bsv-rs/releases)
- [Changelog](https://github.com/Calhooon/bsv-rs/blob/main/CHANGELOG.md)
- [Commits](Calhooon/bsv-rs@v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: bsv-rs
  dependency-version: 0.8.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: bsv-stack
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot @github

dependabot Bot commented on behalf of github Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: dependencies, stack-line. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@github-actions
github-actions Bot enabled auto-merge (rebase) November 17, 2026 18:06
@github-actions

Copy link
Copy Markdown

Auto-merge (rebase) is armed: this PR merges itself when the required checks are green on a current branch (bsv-stack-lean #182). A merge to main deploys nothing.

@github-actions
github-actions Bot merged commit ca15cb4 into main Nov 17, 2026
12 checks passed
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.

0 participants