Skip to content

psbt: it should fail when there is an extra data #2879

@brunoerg

Description

@brunoerg

We noticed that Bitcoin Core fails due to extra data after PSBT while rust-bitcoin seems not checking it. See: bitcoinfuzz/bitcoinfuzz#43

From @apoelstra:

Yep, you can see that https://docs.rs/bitcoin/0.32.0/src/bitcoin/psbt/mod.rs.html#1197-1200 (a) calls Psbt::deserialize rather than encode::deserialize (PSBT has its own serialization module which does not have any no-trailing-data-checks) and (b) does not do any additional checks.

Definitely from_str should have a max length check. Doesn't look like we have any from_slice type method but if we do then it should also do a check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions