Open rustonaut opened 2 years ago
Hm, I think (maybe?, speculate?) the reason why we need to send a close message is so that the client can (somewhat) verify it was incompatible with the "right" server (through your_cookie
wasn't verified). :thinking:
The protocol specifies a close message should be send which we do not do.
Yep, would probably have to do be done explicitly in this case instead of letting it bubble upwards. It's also a minor but still unintended information leak towards the server.
Security impact: Minor, leaks information that no task could be found to the server (although the server is most likely able to extract that information by just counting messages as well).
(The spec is kinda in conflict with itself here, as it in the section of the close message state it must only be send after a successful client handshake).
Agree that there is a slight bug in the spec. On crypto level, authentication is complete once the cookie has been validated, so it's safe to send any messages now, and therefore 'close' messages are no exception. However, the spec does not clearly state that validating the cookie must take place before doing the rest of the list. But it was meant as a strictly ordered list of things to do and in that order. I hope this makes it clearer.
Furthermore the spec states we should close the connection to the server afterwards, as far as I understand this is because at this point in time we already did new where where "correctly" connected with the "right" client (responder) we tried to connect to, but we are fundamentally incompatible. (So no point in still trying to connect to it again or to other responders.)
Correct, there is no point in continuing.
https://github.com/saltyrtc/saltyrtc-client-java/blob/d01e553c06a05c74a532104608c0dc57cb9a23f2/src/main/java/org/saltyrtc/client/signaling/InitiatorSignaling.java#L491-L493
The protocol specifies a close message should be send which we do not do. (The spec is kinda in conflict with itself here, as it in the section of the close message state it must only be send after a successful client handshake).
Furthermore the spec states we should close the connection to the server afterwards, as far as I understand this is because at this point in time we already did new where where "correctly" connected with the "right" client (responder) we tried to connect to, but we are fundamentally incompatible. (So no point in still trying to connect to it again or to other responders.)
Details
Relevant Parts of Spec
From
auth
messageFrom
close
messageCode:
https://github.com/saltyrtc/saltyrtc-client-java/blob/d01e553c06a05c74a532104608c0dc57cb9a23f2/src/main/java/org/saltyrtc/client/signaling/Signaling.java#L449-L452
https://github.com/saltyrtc/saltyrtc-client-java/blob/d01e553c06a05c74a532104608c0dc57cb9a23f2/src/main/java/org/saltyrtc/client/signaling/InitiatorSignaling.java#L86-L97