From 8bb2e96513381ab5abe78d9eafcd494a7f123a00 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 13 Dec 2019 18:11:49 +0300 Subject: [PATCH] Correct identification during authentication procedure --- doc/news.ru.texi | 5 +++++ doc/news.texi | 5 +++++ src/sp.go | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 54dbe00..237af0f 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -5,6 +5,11 @@ @subsection Релиз 5.1.2 @itemize +@item +Исправлена @strong{критичная} уязвимость: аутентификация online нод +могла приводить к некорректной идентификации удалённой стороны, позволяя +скачивать чужие зашифрованные пакеты. + @item Исправлена ошибка: в новосозданных конфигурационных файлах, приватный публичный ключ Noise были поменяны местами, что приводило к diff --git a/doc/news.texi b/doc/news.texi index 85095ba..6275980 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -7,6 +7,11 @@ See also this page @ref{Новости, on russian}. @section Release 5.1.2 @itemize +@item +@strong{Critical} vulnerability: remote peers authentication could lead +to incorrect identification of remote side, allowing foreign encrypted +packets downloading. + @item Bugfix: private and public Noise keys were swapped in newly created configuration files, that lead to inability to authenticate online peers. diff --git a/src/sp.go b/src/sp.go index b6e49b4..c5cfb07 100644 --- a/src/sp.go +++ b/src/sp.go @@ -415,8 +415,9 @@ func (state *SPState) StartR(conn ConnDeadlined) error { } var node *Node - for _, node = range state.Ctx.Neigh { - if subtle.ConstantTimeCompare(state.hs.PeerStatic(), node.NoisePub[:]) == 1 { + for _, n := range state.Ctx.Neigh { + if subtle.ConstantTimeCompare(state.hs.PeerStatic(), n.NoisePub[:]) == 1 { + node = n break } } -- 2.48.1