pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
md5 auth procotol - can it be replayed?
4+ messages / 3 participants
[nested] [flat]

* md5 auth procotol - can it be replayed?
@ 2016-05-07 15:38 Nagy László Zsolt <gandalf@shopzeus.com>
  2016-05-07 15:51 ` Re: md5 auth procotol - can it be replayed? Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Nagy László Zsolt @ 2016-05-07 15:38 UTC (permalink / raw)
  To: pgsql-admin

How the md5 hashed authentication method works? Is it protected against
replay attacks? Here is what I have in mind:

* If the server stores salted hashed passwords, then I do not see how
the server could authenticate the users without getting the password in
clear text?
* If the server stores (unsalted) password hash values, then basically
there is almost no difference between a clear text password and an md5
hash, because anyone can replay the send the same hash value and log in
again.

Am I missing something?

Thanks,

   Laszlo




-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: md5 auth procotol - can it be replayed?
  2016-05-07 15:38 md5 auth procotol - can it be replayed? Nagy László Zsolt <gandalf@shopzeus.com>
@ 2016-05-07 15:51 ` Stephen Frost <sfrost@snowman.net>
  2016-05-07 16:28   ` Re: md5 auth procotol - can it be replayed? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Stephen Frost @ 2016-05-07 15:51 UTC (permalink / raw)
  To: Nagy László Zsolt <gandalf@shopzeus.com>; +Cc: pgsql-admin

Greetings,

* Nagy László Zsolt (gandalf@shopzeus.com) wrote:
> How the md5 hashed authentication method works? Is it protected against
> replay attacks? Here is what I have in mind:
> 
> * If the server stores salted hashed passwords, then I do not see how
> the server could authenticate the users without getting the password in
> clear text?

If you're interested in how these things can be addressed, you should
review the SCRAM protocol.

> * If the server stores (unsalted) password hash values, then basically
> there is almost no difference between a clear text password and an md5
> hash, because anyone can replay the send the same hash value and log in
> again.

If the hash was sent in the clear, then that would be true, but it
isn't.

> Am I missing something?

There is a challenge/response compoent, so the md5 hash which is stored
is not what is sent across the wire.  That prevents replay attacks when
the attacker is simply sniffing the network.  If the attacker is able to
acquire the as-stored hash then, yes, that can be used to authenticate.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: md5 auth procotol - can it be replayed?
  2016-05-07 15:38 md5 auth procotol - can it be replayed? Nagy László Zsolt <gandalf@shopzeus.com>
  2016-05-07 15:51 ` Re: md5 auth procotol - can it be replayed? Stephen Frost <sfrost@snowman.net>
@ 2016-05-07 16:28   ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-05-07 17:53     ` Re: md5 auth procotol - can it be replayed? Nagy László Zsolt <gandalf@shopzeus.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-05-07 16:28 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: Nagy László Zsolt <gandalf@shopzeus.com>; pgsql-admin

Stephen Frost <sfrost@snowman.net> writes:
> * Nagy László Zsolt (gandalf@shopzeus.com) wrote:
>> Am I missing something?

> There is a challenge/response compoent, so the md5 hash which is stored
> is not what is sent across the wire.  That prevents replay attacks when
> the attacker is simply sniffing the network.

Worth noting here is that the challenge key space is not all that huge,
so an attacker who captures a large number of challenge/response pairs
would have a good probability of being able to answer the next challenge
successfully.  However, if you're concerned about sniffing of your
database connections happening on that scale, you really ought to be using
SSL encryption which would make the whole thing moot.  In many cases,
capturing a database session would reveal lots of interesting data passing
over the wire whether or not you'd captured a usable password --- so I'd
call it fairly irresponsible to not be using SSL if you think your
connection is open to sniffing.

			regards, tom lane


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: md5 auth procotol - can it be replayed?
  2016-05-07 15:38 md5 auth procotol - can it be replayed? Nagy László Zsolt <gandalf@shopzeus.com>
  2016-05-07 15:51 ` Re: md5 auth procotol - can it be replayed? Stephen Frost <sfrost@snowman.net>
  2016-05-07 16:28   ` Re: md5 auth procotol - can it be replayed? Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-05-07 17:53     ` Nagy László Zsolt <gandalf@shopzeus.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Nagy László Zsolt @ 2016-05-07 17:53 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-admin


>> There is a challenge/response compoent, so the md5 hash which is stored
>> is not what is sent across the wire.  That prevents replay attacks when
>> the attacker is simply sniffing the network.
> Worth noting here is that the challenge key space is not all that huge,
> so an attacker who captures a large number of challenge/response pairs
> would have a good probability of being able to answer the next challenge
> successfully.  However, if you're concerned about sniffing of your
> database connections happening on that scale, you really ought to be using
> SSL encryption which would make the whole thing moot.  In many cases,
> capturing a database session would reveal lots of interesting data passing
> over the wire whether or not you'd captured a usable password --- so I'd
> call it fairly irresponsible to not be using SSL if you think your
> connection is open to sniffing.
Thank you for your responses, this is exactly what I was looking for.



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-05-07 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-07 15:38 md5 auth procotol - can it be replayed? Nagy László Zsolt <gandalf@shopzeus.com>
2016-05-07 15:51 ` Stephen Frost <sfrost@snowman.net>
2016-05-07 16:28   ` Tom Lane <tgl@sss.pgh.pa.us>
2016-05-07 17:53     ` Nagy László Zsolt <gandalf@shopzeus.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox