Re: Replay attack of query cancel

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Replay attack of query cancel
Дата
Msg-id 489CB293.7070205@hagander.net
обсуждение исходный текст
Ответ на Re: Replay attack of query cancel  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Replay attack of query cancel  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Alvaro Herrera wrote:
> Heikki Linnakangas wrote:
> 
>> One idea for fixing this is to make cancellation keys disposable, and  
>> automatically issue a new one through the main connection when one is  
>> used, but that's not completely trivial, and requires a change in both  
>> the clients and the server. Another idea is to send the query cancel  
>> message only after SSL authentication, but that is impractical for libpq  
>> because we PQcancel needs to be callable from a signal handler.
> 
> I wonder if we can do something diffie-hellman'ish, where we have a
> parameter exchanged in the initial SSL'ed handshake, which is later used
> to generate new cancel keys each time the previous one is used.

Seems much more complex than needed.

IIRC, the protocol allows us (at least does not explicitly forbid) to
issue new cancel keys at any time. And libpq will, again IIRC, accept
them. So we could just change the server to issue a new cancel key
whenever it has used the previous one (since the new key will then be
sent over the encrypted channel, we're safe).

The problem was (third IIRC here :-P) in other clients, such as the JDBC
driver (I think that one was checked specifically) which currently only
accept the BackendKeyData message during startup. All drivers not based
on libpq would have to be checked and potentially updated, but it's
sitll a lot easier than DHing or so.

//Magnus


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Replay attack of query cancel
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Replay attack of query cancel