Fwd: SSPI authentication ASC_REQ_REPLAY_DETECT flag

From: Jacobo Vazquez <jvazquez(at)denodo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fwd: SSPI authentication ASC_REQ_REPLAY_DETECT flag
Date: 2015-03-31 16:40:40
Message-ID: CADdJUUKzrkab_rMRNhKctx3VR2_PRtsS8bak7nKg=VRzw=eEjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-odbc

Hi all,

I installed PostgreSQL 9.3 on a Windows Server 2012 and I have
configured it to use SSPI authentication. The client is on a Windows 7
machine and make the connections via ODBC using a DSN with psqlodbc driver
version 9.03.04.00. Authentication works in this scenario for the user
authenticated in the client machine. I am always using the same user for
connections.

I used Wireshark in the configuration phase to analyze the traffic
between the server and the client. It looks to me that in the
authentication phase, the client always sends the same service ticket to
postgresql server when a new connection is created, even when I create a
new DSN pointing to the same server, it keeps sending the same service
ticket.

Analyzing the source code, in the file src/backend/libpq/auth.c looks
like the server is not checking if the service ticket is reused:

r = AcceptSecurityContext(&sspicred,
sspictx,
&inbuf,
ASC_REQ_ALLOCATE_MEMORY,
SECURITY_NETWORK_DREP,
&newctx,
&outbuf,
&contextattr,
NULL);

The fourth parameter is not using the ASC_REQ_REPLAY_DETECT flag.

Am I misunderstanding something or is this the expected behavior? This
not means a replay attack risk? I think that if SSL is not used by the
connection, a malicious user could capture the authentication package which
the client service ticket and then reuse it.

Thanks in advance
--

--
*Jacobo Vázquez Lorenzo*
Product Development
Denodo Technologies
(+34) 981 10 02 00 Phone
jvazquez(at)denodo(dot)com
www.denodo.com Legal Notice
The message is intended for the addresses only and its contents and any
attached files are strictly confidential.
If you have received it in error, please remove this mail and contact
postmaster(at)denodo(dot)com(dot)
Thank you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2015-03-31 17:12:22 Re: Partial index-based load balancing
Previous Message Mike Roest 2015-03-31 15:31:29 inputs into query planner costing

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-03-31 16:58:27 Re: Bug fix for missing years in make_date()
Previous Message Thom Brown 2015-03-31 16:25:48 Re: printing table in asciidoc with psql

Browse pgsql-odbc by date

  From Date Subject
Next Message Adrian Klaver 2015-03-31 18:33:03 Re: RPM meta package
Previous Message Jeremiah Penery 2015-03-31 16:06:01 RPM meta package