{"id":"GHSA-j8hr-pjhm-6h27","aliases":["GHSA-j8hr-pjhm-6h27","RUSTSEC-2026-0498","RUSTSEC-2026-0500"],"related":[],"kind":"vulnerability","state":"published","title":"Transaction readers accept trailing bytes, so a parsed transaction can carry another transaction id","summary":"`Transaction::from_binary` and `Transaction::from_hex` read one transaction\nfrom the front of their input, did not check that the input ended there, and\nkept the whole input as the transaction's cached serialization: `to_binary`,\n`to_hex` and `id()` then answered for bytes that are not the transaction's.\n`Transaction::from_json`, given a `hex` field, reads it through `from_hex` and\nanswers the same. `from_ef`, `from_hex_ef` and `parse_script_offsets` also\nread a prefix.\n\nAn application that takes bytes or hex from outside, parses them with these\nreaders and then uses `id()` or the serialization could be given one\ntransaction under another identity: the same parsed fields, a different id.\nAn application that passes them only bytes it produced or has already checked\nis not affected.\n\n0.8.5 refuses a byte after the transaction; `Transaction::from_reader` reads\nfrom the front of a longer buffer. Where upgrading is not possible, parse with\n`Transaction::from_binary`, call `tx.invalidate_caches()` (public from 0.3.16)\nand require `tx.to_binary() == bytes`.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"`Transaction::from_binary` and `Transaction::from_hex` read one transaction\nfrom the front of their input, did not check that the input ended there, and\nkept the whole input as the transaction's cached serialization: `to_binary`,\n`to_hex` and `id()` then answered for bytes that are not the transaction's.\n`Transaction::from_json`, given a `hex` field, reads it through `from_hex` and\nanswers the same. `from_ef`, `from_hex_ef` and `parse_script_offsets` also\nread a prefix.\n\nAn application that takes bytes or hex from outside, parses them with these\nreaders and then uses `id()` or the serialization could be given one\ntransaction under another identity: the same parsed fields, a different id.\nAn application that passes them only bytes it produced or has already checked\nis not affected.\n\n0.8.5 refuses a byte after the transaction; `Transaction::from_reader` reads\nfrom the front of a longer buffer. Where upgrading is not possible, parse with\n`Transaction::from_binary`, call `tx.invalidate_caches()` (public from 0.3.16)\nand require `tx.to_binary() == bytes`.","format":"markdown","source":"rustsec"},{"lang":"en","text":"`Beef::merge_raw_tx` and `BeefTx::from_raw_tx` accept raw bytes without a\n`Result`. For bytes that are not exactly one transaction (a transaction\nfollowed by bytes, a cut transaction, bytes that are no transaction at all),\n`Beef::sort_txs`, `verify_structure`, `verify_valid` and `is_valid` could\nanswer valid, even with no BUMP and no parent in the BEEF, and, where the entry\ncarried a BUMP index, treat the hash of those bytes as a proven transaction id;\nan entry that names it as a parent was answered valid too.\n\nThe wire readers (`Beef::from_binary`, `verify_stream`,\n`Transaction::from_beef`, `from_atomic_beef`) parse every entry and are not\naffected. Reaching this needs an application that passes bytes it did not\nparse to `merge_raw_tx` or `BeefTx::from_raw_tx` and then relies on the verdict\nor on the transaction the BEEF hands back.\n\n0.8.5 refuses such an entry at all four verdict doors, with or without a BUMP\nindex, and every entry that names it as a parent. Where upgrading is not\npossible, do not rely on `is_valid` or `verify_valid` alone for such an entry:\ncheck that the bytes are exactly one transaction before merging them.","format":"markdown","source":"rustsec"}],"published":"2026-11-10T12:00:00.000Z","modified":"2026-11-12T08:11:08.643Z","severity":{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.8.5"},{"type":"semver","introduced":"0.9.0-beta.1","status":"affected","fixed":"0.9.0-beta.7.0"}],"ecosystem":"crates.io","package":"bsv-rs","purl":"pkg:cargo/bsv-rs","source":"rustsec"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.8.5"},{"type":"semver","introduced":"0.9.0-beta.1","status":"affected","fixed":"0.9.0-beta.7.0"}],"ecosystem":"crates.io","package":"bsv-rs","purl":"pkg:cargo/bsv-rs","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/bsv-rs","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0498.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/Calhooon/bsv-rs/blob/v0.8.5/CHANGELOG.md","tags":["web"],"sources":["rustsec"]},{"url":"https://github.com/Calhooon/bsv-rs/issues/840","tags":["report"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0500.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/Calhooon/bsv-rs/pull/852","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0498","url":"https://rustsec.org/advisories/RUSTSEC-2026-0498.html","licence":"CC0-1.0","modified":"2026-11-12T08:11:08.643Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0500","url":"https://rustsec.org/advisories/RUSTSEC-2026-0500.html","licence":"CC0-1.0","modified":"2026-11-12T08:11:08.643Z"}],"updatedAt":"2026-11-25T22:56:43.489Z"}