Skip to content

Weak validation on seller side of JoinContract handler #2

@bedeho

Description

@bedeho

Background

The handler ReadyForInvitation::react(const event::Recv<protocol_wire::JoinContract> & e) currently checks that

  • the peer is in fact a buyer: if this guard fails, we throw InvitedToJoinContractByNonBuyer
  • the peer is inviting us with reference to the most up to date terms we have announced: if this guard fails we trigger callback _invitedToOutdatedContract.

If the first guard fails, then we know the peer has misbehaved, while the latter guard may be triggered by honest peers if they have not yet seen our most recent terms on their end of the wire.

Problem

We are not checking that the buyer has actually most recently advertised terms which are compatible with our most recent terms, if not, then we should be ignoring the message. Just checking the buy mode is not sufficient.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions