Skip to content

Malformed TLV suffixes are silently dropped instead of rejected #2356

Description

@bit-aloo

parse_message_frame_with_tlvs treats the bytes after the base message as a TLV list, but TlvList::for_extensions filters out iterator errors. A trailing TLV whose declared length exceeds the remaining bytes therefore yields Ok((message, None)) and the base message is dispatched as if no extension data had been sent. TlvIter stops at the first error, so every later field is lost too. Malformed extension data from an authenticated peer fails open.

Fix: propagate the first TlvError from extract_tlv_fields as a ParserError so the frame is
rejected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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