Skip to content

bsv-rs 0.8.10

Choose a tag to compare

@Calgooon Calgooon released this 15 Nov 23:18
· 18 commits to main since this release

A stable patch release of security fixes: nine advisories of this repository are fixed in 0.8.10, and a further one, published with it, names no fixed version: 0.8.10 adds the functions it asks a caller to use.

Affected by a published advisory: GHSA-67vc-6c8g-7x48 (low, CVSS 3.7), patched in 0.8.11.
Affected by a published advisory: GHSA-cgp9-rj5h-jxw6 (medium, CVSS 5.3), patched in 0.8.11.
Affected by a published advisory: GHSA-gvmh-f5gf-5vjj (high, CVSS 7.5), patched in 0.8.11.

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 caller that keeps GlobalKVStore entries keeps its own record of them before upgrading and writes them again after.

Advisories

  • Fixes GHSA-4mcm-g5xq-jv3r: a GlobalKVStore token signed with the constant key ID kvstore-token passed this crate's signature checks, and on the stable line every door that judges a token, though its signature does not bind the key.
  • Fixes GHSA-89w7-x33x-6m9c: KVStoreInterpreter::interpret and interpret_script return an entry for a KVStore token whose signature is not checked, so a peer's unsigned token reads as a controller's value.
  • Fixes GHSA-w6jf-m9c7-6599: RegistryClient's resolve functions return an unsigned definition as its named registry operator's.
  • Fixes GHSA-crr5-gh8p-q2h2: LivePolicy::refresh panics on a fee-policy response whose miningFee.bytes is 0, and the kilobyte fee model overflows on an out-of-range rate, an abort on wasm32.
  • Fixes GHSA-x3m6-jp5x-236c: decode_bip276 and the identity key abbreviation panic on a string with a multi-byte character at a cut, an abort on wasm32.
  • Fixes GHSA-vmgj-w2jr-c52x: the P2PKH/P2PK/P2SH/multisig template classifiers accept non-minimal push encodings, so a non-standard locking script is reported as a standard template paying a given address/key.
  • Fixes GHSA-qhj8-j8mj-9cgc: WhatsOnChainBroadcaster and ArcBroadcaster report the broadcast service's response text as the transaction's txid without checking it against the submitted transaction's own id.
  • Fixes GHSA-fr33-7jw7-mwwh: the default script mode does not run a pre-Genesis P2SH coin's redeem script, so a spend the node refuses is verified as valid.
  • Fixes GHSA-h4m7-c6p8-725m: the default script mode judges a coin created before Genesis by the post-Genesis rules alone, so a spend those rules accept and the coin's own era refuses is verified as valid.
  • GHSA-82g9-h6jw-r99f: 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 version changes what from_ef and from_hex_ef ask for; read Extended Format bytes from a party you do not trust with from_ef_bounded or from_hex_ef_bounded.
  • Affected by GHSA-67vc-6c8g-7x48 (low, CVSS 3.7): bsv-rs: sighash::parse_transaction read a transaction from the front of a longer buffer and dropped the rest. Patched in 0.8.11.
  • Affected by GHSA-cgp9-rj5h-jxw6 (medium, CVSS 5.3): bsv-rs: HttpRequest::from_payload and HttpResponse::from_payload read a message from the front of a longer payload and dropped the trailing bytes. Patched in 0.8.11.
  • Affected by GHSA-gvmh-f5gf-5vjj (high, CVSS 7.5): bsv-rs: Beef::add_input_proof holds a full copy of a shared parent per spending input, so an untrusted overlay answer within the lookup resolver’s size bound can force multi-gigabyte heap (memory-exhaustion denial of service). Patched in 0.8.11.

What changed

  • GlobalKVStore and the KVStore interpreter: a token authenticates only in the form whose signature binds its key, and the interpreter returns an entry only for a token its controller signed and its writer locked; set writes that form and refuses an empty value.
  • The registry resolves return a definition only when they can authenticate it as its named operator's.
  • The fee-policy reader refuses a policy no service could hold, and the kilobyte fee model refuses a fee that does not fit in a u64.
  • The BIP-276 decoder and the identity key abbreviation answer every string: a multi-byte character at a cut is refused or kept whole, never a panic.
  • The P2PKH, P2PK, P2SH and multisig template classifiers match the template's bytes exactly: a push of the hash or key by another opcode is no template.
  • A broadcaster's success answers the submitted transaction's own id: a 2xx naming another transaction is a refusal.
  • Transaction::from_ef_bounded and Transaction::from_hex_ef_bounded read an Extended Format transaction under a caller's figure for the source outputs its inputs build; from_ef and from_hex_ef answer as before.
  • The default script mode runs the node's pay-to-script-hash step for a coin locked by OP_HASH160 <20 bytes> OP_EQUAL, so a spend the node refuses is no longer answered valid.
  • A coin proven below the chain's Genesis height is judged by the rules of its era as well, so a spend those rules refuse is no longer answered valid; a caller on a test chain names its chain's Genesis height in its tip.
  • On this line also: the SLAP and SHIP discoveries admit a host only from an advertisement its identity's linked key signed and locks, and the storage downloader names a host only from an advertisement its host signed and locks, for the file asked for (the stable line's port of fixes the 0.9 line carries; their commits' -x lines name commits beta already carries).

Where

  • main: #1011, ending at 945886d4; beta: #1010, ending at b9f4ffde.
  • Every entry, with what was wrong, the reach, the fix, the tests and the migration: CHANGELOG.md, this version's section.