shadowsocks / go-shadowsocks2

Modern Shadowsocks in Go
Apache License 2.0
4.45k stars 1.39k forks source link

Fix a race condition that could allow same Salt/IV to be reused #201

Closed xiaokangwang closed 3 years ago

xiaokangwang commented 3 years ago

If the attacker have precise timing, it could be possible for it to trick ss into accept multiple connection with the same Salt/IV if they all pass the Salt/iv test at the same time if while other connection c.Encrypter(salt) is in process, and before they add that IV into the anti-replay pool.

This PR does not solve any protocol weakness.

riobard commented 3 years ago

Thanks for the PR! :)