# GHSA-j8hr-pjhm-6h27: Transaction readers accept trailing bytes, so a parsed transaction can carry another transaction id

- Severity: Medium 5.3 (CVSS:3.1, scored by RustSec Advisory Database) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-11-10T12:00:00.000Z
- Modified: 2026-11-12T08:11:08.643Z
- Also known as: RUSTSEC-2026-0498, RUSTSEC-2026-0500

## Description

`Transaction::from_binary` and `Transaction::from_hex` read one transaction
from the front of their input, did not check that the input ended there, and
kept the whole input as the transaction's cached serialization: `to_binary`,
`to_hex` and `id()` then answered for bytes that are not the transaction's.
`Transaction::from_json`, given a `hex` field, reads it through `from_hex` and
answers the same. `from_ef`, `from_hex_ef` and `parse_script_offsets` also
read a prefix.

An application that takes bytes or hex from outside, parses them with these
readers and then uses `id()` or the serialization could be given one
transaction under another identity: the same parsed fields, a different id.
An application that passes them only bytes it produced or has already checked
is not affected.

0.8.5 refuses a byte after the transaction; `Transaction::from_reader` reads
from the front of a longer buffer. Where upgrading is not possible, parse with
`Transaction::from_binary`, call `tx.invalidate_caches()` (public from 0.3.16)
and require `tx.to_binary() == bytes`.

(As written by RustSec Advisory Database.)

## Affected

- bsv-rs (crates.io): from 0.0.0-0 before 0.8.5; from 0.9.0-beta.1 before 0.9.0-beta.7.0

## Every score

- RustSec Advisory Database: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- RustSec Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`

## References

- <https://crates.io/crates/bsv-rs> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0498.html> (advisory)
- <https://github.com/Calhooon/bsv-rs/blob/v0.8.5/CHANGELOG.md> (web)
- <https://github.com/Calhooon/bsv-rs/issues/840> (report)
- <https://rustsec.org/advisories/RUSTSEC-2026-0500.html> (advisory)
- <https://github.com/Calhooon/bsv-rs/pull/852> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0498](https://rustsec.org/advisories/RUSTSEC-2026-0498.html), CC0-1.0, modified 2026-11-12
- RustSec Advisory Database: [RUSTSEC-2026-0500](https://rustsec.org/advisories/RUSTSEC-2026-0500.html), CC0-1.0, modified 2026-11-12

---

Page: https://cve.day/GHSA-j8hr-pjhm-6h27 · Whole record: https://cve.day/GHSA-j8hr-pjhm-6h27.json · Rebuilt by cve.day 2026-11-25T22:56:43.489Z
