saltyrtc / saltyrtc-server-python

SaltyRTC signalling server implementation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unencrypted client-auth message is accepted

dbrgn opened this issue · comments

When sending an unencrypted client-hello message, followed by an unencrypted client-auth message, the server accepts that without any error.

Never mind, I was wrong 🤦‍

commented

😨

Oh. Actually it's true, but with slightly different steps to reproduce:

When skipping the client-hello message (therefore acting as initiator), an unencrypted client-auth message is accepted:

[2017-11-14 13:23:12.949524] INFO: saltyrtc.path.18.client.7f3bac0f0d48: Connection established
[2017-11-14 13:23:12.949579] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Worker started
[2017-11-14 13:23:12.949630] DEBUG: saltyrtc.server: Protocol registered: <saltyrtc.server.server.ServerProtocol object at 0x7f3bab670278>
[2017-11-14 13:23:12.949688] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Starting handshake
[2017-11-14 13:23:12.949832] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Sending server-hello
[2017-11-14 13:23:12.949885] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Packing message: MessageType.server_hello
[2017-11-14 13:23:12.949968] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Sending message
[2017-11-14 13:23:12.950048] DEBUG: websockets.protocol: server >> Frame(fin=True, opcode=2, data=b'\x16%\x80j-\xc0\xfaq\x15S\xd3e\x95C\xa8\xd8\x00\x00\x00\x00\xc8\xb3-_\x82\xa4type\xacserver-hello\xa3key\xc4 \xcd\xdb\xfc\x87\xe4\xd3P\xe6\x8e\xdc\x848j\x07\xe2\n\xe4\xa7\xe6\x08D\xd3y\xd2\xc6\xf7!E\x07f\x06\n')
[2017-11-14 13:23:12.950145] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Waiting for client-hello
[2017-11-14 13:23:12.990436] DEBUG: asyncio: poll took 39.798 ms: 1 events
[2017-11-14 13:23:12.990825] DEBUG: websockets.protocol: server << Frame(fin=True, opcode=2, data=b'vM\xf9\x99\x15\xaem\xf6\x04\xab\xc9j\r\xc0\xcf\xbd\x00\x00\x00\x00\x16.l\xd8\x84\xa4type\xabclient-auth\xabyour_cookie\xc4\x10\x16%\x80j-\xc0\xfaq\x15S\xd3e\x95C\xa8\xd8\xacsubprotocols\x91\xafv1.saltyrtc.org\xadping_interval\x00')
[2017-11-14 13:23:12.992220] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Received message
[2017-11-14 13:23:12.992503] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Unpacked message: MessageType.client_auth
[2017-11-14 13:23:12.992570] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Received client-auth
[2017-11-14 13:23:12.992618] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Validating cookie
[2017-11-14 13:23:12.992664] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Checking for subprotocol downgrade, client: ['v1.saltyrtc.org'], server: ['v1.saltyrtc.org']
[2017-11-14 13:23:12.992720] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48: Setting keep-alive interval to 0
[2017-11-14 13:23:12.992770] DEBUG: saltyrtc.path.18: Set initiator PathClient(role=0x01, id=0, at=0x7f3bac0f0d48)
[2017-11-14 13:23:12.992829] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48.0x01: Assigned id: 1
[2017-11-14 13:23:12.992964] DEBUG: saltyrtc.path.18.client.7f3bac0f0d48.0x01: Sending server-auth including responder ids
commented

I'll add a test, so this never happens again.