The TLS/SSLv3 renegotiation vulnerability explained

Thierry Zoller
Thierry ZollerInformation Security and Privacy Risk Manager

The whitepaper explains the SSLv3/TLS renegotiation vulnerability (CVE-2009-3555) to a broader audience and goes into details about the different attack vectors possible. The whitepaper includes original research such as downgrading the client down to clear-text protocol transparently. The paper is referenced by the US-CERT, FINCERT, RUS-CERT, Qualys, Nessus as the main reference for this vulnerability.

TLS / SSLv3 renegotiation
vulnerability explained

                     Thierry ZOLLER
                     contact@g-sec.lu
                     http://www.g-sec.lu
                     http://blog.zoller.lu




            G-SEC™ is a non-commercial and independent group of
            Information Security Specialists based in Luxembourg.
TLS & SSLv3 renegotiation vulnerability 2011

1. Table of Contents
2.        Synopsis ........................................................................................................................................... 3
3.        Revisions .......................................................................................................................................... 4
4.        Generic TLS renegotiation prefix injection vulnerability .................................................................... 5
     4.1.        Details ...................................................................................................................................... 6
5.        HTTPS .............................................................................................................................................. 7
     5.1.        First method - Injecting commands into an HTTPS session ........................................................ 8
     5.2.        Details ...................................................................................................................................... 9
     5.3.        Second method - HTTPS to HTTP downgrade attack................................................................ 10
     5.4.        Details .................................................................................................................................... 11
     5.5.        Third method - Injecting custom responses through TRACE .................................................... 12
     5.6.        Details .................................................................................................................................... 13
6.        SMTPS ............................................................................................................................................ 14
     Protocol vulnerability matrix .............................................................................................................. 14
          The attacker does NOT have an account on the SMTP server ......................................................... 14
          The Attacker has an account on the SMTP server ........................................................................... 14
     Attack scenario - SMTP STARTTLS (110) .............................................................................................. 15
     Details................................................................................................................................................ 16
     Client side attack detection ................................................................................................................ 17
     Important Note .................................................................................................................................. 17
7.        FTPS ............................................................................................................................................... 18
     Client certificate based authentication (Control Channel)................................................................... 19
     Renegotiations due to NAT support (Data Channel) ........................................................................... 19
     Resetting the TCP connection and injecting in mid transfer ................................................................ 19
8.        The Impact on other protocols using TLS ........................................................................................ 21
9.        Summary........................................................................................................................................ 21
     EAP-TLS .............................................................................................................................................. 22
10. Solutions ........................................................................................................................................ 23
     1.      Proposed IETF solution ............................................................................................................... 23
11. Patching TLS ................................................................................................................................... 23
          Client ............................................................................................................................................. 23
          Server ............................................................................................................................................ 23
                                                                                                                                                               2
TLS & SSLv3 renegotiation vulnerability 2011

12. Patching SSLv3 ............................................................................................................................... 23
13. Testing for a renegotiation vulnerability ......................................................................................... 24
    Vulnerability requirements ................................................................................................................ 24
    Generic Example ................................................................................................................................ 24
    Patched server with disabled renegotiation ....................................................................................... 24
14. Conclusions .................................................................................................................................... 25
    Servers............................................................................................................................................... 25
    Clients................................................................................................................................................ 25
    Sources .............................................................................................................................................. 25
    Thanks ............................................................................................................................................... 25
15. Disclaimer ...................................................................................................................................... 25



2. Synopsis
Around the 09/11/2009 Marsh Ray, Steve Dispensa and Martin Rex published details1 about a
vulnerability affecting the TLS and the SSLv3 protocol. The vulnerability is being tracked under
CVE-2009-35552 | VU#1205413 and affects a multitude of platforms and protocols, the impact
of this vulnerability varies from protocol to protocol and from application to application. There
is extensive research required in order to assess

When speaking of a “Man in the Middle” attack, it is often assumed that data can be altered or
changed. Indeed an attacker that sits in the middle of a connection (hence it’s name) is often
able to do so. In this particular case however the attacker piggybacks an existing authenticated
and encrypted TLS sessions in order to (prefix) inject arbitrary text of its choice. The attacker
may not read/alter the other TLS session between the “client” and the “server”.

This paper explains the vulnerability for a broader audience and summarizes the information
that is currently available. The document is prone to updates and is believed to be accurate by
the time of writing.

Important: This vulnerability is not limited to HTTPS, this vulnerability potentially affects every
application/protocol that implements TLS or SSLv3.

This paper is referenced by the US-CERT, DFN-CERT, BELNET-CERT, SWITCH-cert,Nessus, Qualys, c't
Heise, and many more. Furthermore it has served as a internal Training paper for a major OS vendor.


1
    http://www.extendedsubset.com/
2
    http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3555
3
    http://www.kb.cert.org/vuls/id/120541
                                                                                                                                                            3
TLS & SSLv3 renegotiation vulnerability 2011

3. Revisions

 Version       Date         Annotations
 0.8           09.11.2009   Initial draft
 0.81          10.11.2009   Adding general and specific example
 0.9           12.11.2009   Added vulnerability requirements, protocol overview
 0.91          12.11.2009   Initial public draft release at http://www.g-sec.lu/
 0.92          13.11.2009   Corrected few errors
 0.93          17.11.2009   Added test cases and SMTP over TLS details
 0.95          24.11.2009   Added FTPS details, fixed syntax and formatting
                            errors, added IIS7 clarifications
 0.96          25.11.2009   New test cases
 0.97          27.11.2009   Added HTTPS TRACE and HTTPS to HTTP downgrade
                            attack
 0.98          29.11.2009   Added 2 POC files for the TRACE and HTTPS to HTTP
                            downgrade attack
 0.99          22.12.2011   Added the correction sent in by Alun Jones
 1.0           23.12.2011   Grammar, Better PDF support, release of Final version




                                                                                    4
TLS & SSLv3 renegotiation vulnerability 2011

4. Generic TLS renegotiation prefix injection vulnerability




                                                                       5
TLS & SSLv3 renegotiation vulnerability 2011

4.1.       Details
   1         “Client” starts the TLS handshake – Attacker does not forward these immediately


   1.1       The attacker negotiates a new session performs a full TLS exchange


   1.2       The attacker sends application level commands over the previously established TLS
             session (#2)

       2     Renegotiation is triggered either
                1. because of Certificate based auth (server sees get /dir and decides it needs
                   an certificate for „directory“)
                2. due to different cipher requriements on different ressources (Server
                   initiated)
                3. by the client


       3     The TLS handshake started at 1 and hold back by the attacker, is now being let to
             the server which performs a new TLS Handshake over the previously established
             encrypted TLS session #2 (Attacker<>Server)


       4     The TLS endpoint, due to the renegotiation has to take into the account the
             previously sent data (per spec), the endpoint believes the previous data (1.2) to
             have been send from the same client. As such this request is prefixed to the one
             issued by the client in 4 (See HTTPS example for a more explicit example)




                                                                                                  6
TLS & SSLv3 renegotiation vulnerability 2011

5. HTTPS
There are multiple ways to abuse HTTPS in order to inject traffic into an authenticated stream.
An additional attack vector was uncovered by Frank Heidt (Leviathan Security) but not published
and rediscovered by Thierry Zoller (G-SEC) for this paper, this vector allows downgrading an
existing SSL session to plain text.

This paper will present 2 new methods to leverage the TLS renegotiation vulnerability

      1. Injecting plaintext and abusing using X-Ignore:/n (Marsh Ray) or using unfinished POST
         to a web application reflecting content (Anil Kurmus)

          Summary: The attacker injects (prepends) GET/POST HTTP commands and does not
          terminate the last command (i.e no CRLF) that way when both http requests (Attacker,
          Victim)    merge,     part     of    the      victim  requests     are     ignored)

      2. Downgrading from HTTPS to HTTP and performing active Man-in-the-Middle –
         according to an online article this was discovered by Frank Heidt but choosen not to
         disclose4 the details; details have been rediscovered for this paper by Thierry Zoller (G-
         SEC)

          Summary: The attacker injects (prepend) a HTTP request to a resource reachable over
          SSL but redirecting the client to HTTP when requested. Such behavior is a common
          occurrence.

      3. “When TRACE comes back to bite you” – After ideas to use TRACE method to leverage
         this flaw appeared in twitter (olle@toolcrypt.org and sirdarckcat) this method was
         researched and turned into a POC by Thierry Zoller.

          Summary: The attacker injects a TRACE command, by doing so the attacker can control
          the content that is send from the server to the victim over HTTPS




4
    http://www.pcworld.com/article/182720/security_pro_says_new_ssl_attack_can_hit_many_sites.html
                                                                                                     7
TLS & SSLv3 renegotiation vulnerability 2011

5.1.   First method - Injecting commands into an HTTPS session




                                                                         8
TLS & SSLv3 renegotiation vulnerability 2011

5.2.        Details
This is one example of how this vulnerability might be used to affect HTTPS. We are aware that
in this case a simple XSRF5 attack could have achieved the same effect, however this is a easy to
understand example. This attack can be used to abuse specific features of the affected web
application, for example a POC has been demonstrated on how to steal Twitter credentials using
this flaw6.

      1.1      The attacker negotiates a new session performs a full TLS exchange

               The attacker sends a GET request to a fictional weak e-banking application. Note that
      1.2
               the attacker can add multiple requests due to HTTP1.1 pipelining but that only the last
               request usurps the cookie.

       2       Renegotiation is triggered


               The TLS handshake started at 1 and hold back by the attacker, is now being let to
       3
               the server which performs a new TLS Handshake over the previously established
               encrypted TLS session #2 (Attacker<>Server)

               The TLS endpoint, due to the renegotiation has to take into the account the
               previously sent data (per spec), the endpoint believes the previous data (1.2) to
               have been send from the same client

               The requests
               1.2 : Attacker -> server
               GET /ebanking/ paymemoney.cgi?acc=LU00000000000000?amount=1000
               Ignore-what-comes-now:
               And
               4: Client->server
               GET /ebanking
               Cookie: AS21389:6812HSADI:3991238

               The request is prefixed to the request issued by the client in (4) and is merged into
               GET /ebanking/ paymemoney.cgi?acc=LU00000000000000?amount=1000
               Ignore-what-comes-now: GET /ebanking
               Cookie: AS21389:6812HSADI:3991238


               Interpreted by the HTTP daemon as :
               GET /ebanking/ paymemoney.cgi?acc=LU00000000000000?amount=1000
               Cookie: AS21389:6812HSADI:3991238
5
    http://en.wikipedia.org/wiki/Cross-Site_Request_Forgery
6
    http://www.securegoose.org/2009/11/tls-renegotiation-vulnerability-cve.html
                                                                                                       9
TLS & SSLv3 renegotiation vulnerability 2011

5.3.Second method - HTTPS to HTTP downgrade attack




                                                                10
TLS & SSLv3 renegotiation vulnerability 2011

5.4.        Details
            7
SSLstrip is a tool presented by Marlin Spikes at Blackhat 2009 - it allows to perform an active
MITM attack by stripping of SSL from the connection of the victim. The attack had one particular
drawback: it was not possible to downgrade an existing SSL session, and only worked if the user
accesses his bank over HTTP first then trying to submit his credentials to HTTPS.

Abusing the TLS renegotiation vulnerability however it is now possible to even apply SSLstrip to
established SSL connections.

The Proof of concept for this attack can be found at : http://www.g-sec.lu/tls-ssl-proof-of-
concept.html

      1.2       The attacker sends a GET request he knows will redirect the HTTP client to a non HTTPS
                page on the server.

       2        Renegotiation is triggered


                The TLS handshake started at 1 and hold back by the attacker, is now being let to
       3
                the server which performs a new TLS Handshake over the previously established
                encrypted TLS session #2 (Attacker<>Server)

                The TLS endpoint, due to the renegotiation has to take into the account the
                previously sent data (per spec), The request is prefixed to the request issued by
                the client in (4) and is merged into one request. The attacker effectively replaced
                the GET request.

                The server replies with a 302 redirecting the victim to an HTTP page

                The HTTP browser of the victim automatically follows the redirect the server has
                sent and requests the HTTP page.

                The attacker is now seeing the clear text requests and can rewrite the HTTP
                request from the victim to his liking – from this point on the attacker continues
                the attack with SSLtrip




7
    http://www.thoughtcrime.org/software/sslstrip/
                                                                                                      11
TLS & SSLv3 renegotiation vulnerability 2011

5.5.   Third method - Injecting custom responses through TRACE




                                                                     12
TLS & SSLv3 renegotiation vulnerability 2011

5.6. Details
TRACE allows the attacker to control the response from the server to the client, contrary to the
original attack that only allowed controlling the request to the server, using trace gives control
over the response (within certain limits).

At the moment is believed that TRACE is unlikely to be used to execute client-side javascript
code, this is due to the “content-type:message/http” header the servers adds to the response
and prompts the browser to initiate a download. Binary content injection through TRACE also
appears not to be possible as the filename the browser saves the data into is not controlled by
the attacker. There are several third-party browsers that use own sockets to send/receive http
data and use the TRIDENT engine (mshtml.dll) to render the WebPages.                     These
implementations are vulnerable to JavaScript injection. The reason is that the IE component
does not see the HTTP header and renders that data as if it would be HTML.




The TRACE method can also be abused for example in situations where custom code is used that
ignores the content-type and just parses for specific data.

For instance one can imagine that several automatic updates protocols and server to server
communications are vulnerable to this attack. As the client expects a response to a GET request
it is likely that developers have not spend time to look into whether the response really comes
from a GET request.

Summary: The attacker injects a TRACE command, by doing so the attacker can control the
content that is send from the server to the victim over HTTPS

The Proof of concept for this attack can be found at : http://www.g-sec.lu/tls-ssl-proof-of-
concept.html


                                                                                               13
TLS & SSLv3 renegotiation vulnerability 2011

6. SMTPS
There are 2 major ways to use TLS with SMTP – STARTTLS and TLS from the beginning. With
STARTTLS you connect to the SMTP port using plain text and then request a TLS connection
using the command “STARTTLS”.

T. ZOLLER (G-SEC) as well as W.VENEMA (Postfix) have researched this protocol independently,
the following represents a summary of what is currently known. VENEMA has published a PDF
that summarizes his views8.

Discussions with M. VENEMA resulted in the following information based attacks in-line with
protocol requirements. A successful attack requires an SMTP server that uses a TLS engine that
reads the data as soon as it arrives, vendors are required to assess the products in order to
determine if their product is vulnerable. Currently there are no independant research results for
SMTP. As an example of software that uses TLS engine in a way required for these attacks to
work, VENEMA cited STUNNEL.

Protocol vulnerability matrix
The following information is believed to be correct by the time of writing

The attacker does NOT have an account on the SMTP server

    Attack theoretically possible if         TLS private cert authentication without SASL
                                             SMTP over TLS without SASL


The Attacker has an account on the SMTP server

    Attack theoretically possible if         TLS private cert authentication without SASL
                                             TLS private cert authentication with SASL
                                             SMTP over TLS with SASL
                                             SMTP over TLS without SASL




8
    http://www.porcupine.org/postfix-mirror/smtp-renegotiate.pdf
                                                                                              14
TLS & SSLv3 renegotiation vulnerability 2011

Attack scenario - SMTP STARTTLS (110)




                                                                   15
TLS & SSLv3 renegotiation vulnerability 2011

Details
This is a complex example of how this vulnerability could be used to exploit SMTP over TLS
(STARTSSL) if the attacker has an account

    1     Attacker connects to the SMTP server and initiates a TLS session (STARTTLS)


   1.1    The attacker negotiates a new session performs a full TLS exchange


   1.2    The attacker sends SMTP commands to the server but does not end the SMTP session,
          in this example the attacker controls the source and destination e-mail addresses.

    2     Renegotiation is triggered


          Attacker initiates a TLS session (TLS HELLO) and the victim performs a new TLS
    3
          Handshake over the previously established encrypted TLS session #2
          (Attacker<>Server)

          The TLS endpoint, due to the renegotiation has to take into the account the
          previously sent data (per spec), the endpoint believes the previous data (1.2) to
          have been send from the same client

          As such the client now receives the answers from the attacker injected commands
          (note this is a way to detect this attack on the client-side).

          The victim SMTP client now issues his commands to send mail – Those commands
          end up in the BODY of the mail previously started by the attacker.

          The SMTP server receives:
          EHLO whatever
          AUTH PLAIN whatever
          MAIL FROM:<attacker-chosen-sender>
          RCPT TO:<attacker-chosen-recipient>
          attacker:DATA
          victim:EHLO
          victim:AUTH PLAIN whatever
          victim:MAIL FROM
          victim:whatever
          victiim:DATA<crlf>


          As such the :<attacker-chosen-recipient> receives a mail containing the
          authentication data aswell as the other data.
                                                                                              16
TLS & SSLv3 renegotiation vulnerability 2011

Client side attack detection
Contrary to HTTPS protocol the client has a way to detect that he was attacked at the
application layer as the server replies arrive before the victim even sent the commands.

Important Note
To our knowledge POSTFIX is not affected by this vulnerability.




                                                                                     17
TLS & SSLv3 renegotiation vulnerability 2011

7. FTPS
FTPS is a SSL/TLS based implementation of FTP, it is not to be confused with SFTP (Alun Jones:
“SFTP is a completely different protocol – a sub-protocol of SSH. For example, where FTP uses
commands of three or four letters, SFTP uses binary single byte instructions.”).

Alun Jones 9 author of WFTPD has done an impact analysis on FTPS implementations and the
potential vulnerabilities that might be present, the analysis contains an interesting note about
degrading encryption for sake of NAT compatibility which has impact beyond the TLS/SSL
renegotiation vulnerability.

FTPS is particularly interesting because it has two channels, the CONTROL channel and the DATA
channel which can be requested to be encrypted separately. Please refer to the description at
http://www.allaboutjake.com/network/linksys/ftp/ for more insight into FTP connections.

The following information is believed to be correct by the time of writing; the bespoken possible
vulnerabilities are depended on specific FTP client and FTP server implementations. Vendors
need to look into these particular implementations and fix them accordingly.




9
    http://msmvps.com/blogs/alunj/default.aspx
                                                                                              18
TLS & SSLv3 renegotiation vulnerability 2011

Client certificate based authentication (Control Channel)
Contrary to HTTPS, FTPS Client-certificate based auth is unlikely to be vulnerable. Indeed HTTPS
client certificate based authentication it is vulnerable due to a particular circumstance being the
necessity to receive a particular request to a directory prior to choosing whether a certificate is
required or not, the HTTP server then needs to renegotiate.

This is not the case with FTPS, the connection is encrypted from the very start or it isn’t, it is
unlikely the server supports renegotiation at that point. “FTPS resets the command state and
commands are executed in the context that existed at that time, rather than the newly-
authenticated context.”

Renegotiations due to NAT support (Data Channel)
NAT devices need to keep track of connections and have support to rewrite FTP connections on
the fly in order to allow FTP to work over NAT. The problem that appeared with FTPS is that the
NAT devices could not peek into the PASV or PORT commands any longer and as such would not
be able to NAT FTP.

Because of this and to be able to offer FTPS over NAT, several vendors added support for the
CCC 10command (Clear Command Channel). The FTP server will drop the secure connection in
order for the NAT device to be able to rewrite PASV and PORT commands. This allows the
attacker to see the control channel in clear text. This allows the attacker to know WHEN and
WHAT files are currently being transferred, if the server accepts TLS renegotiations the attacker
might then, timed to the clear text control channel, inject data into files being uploaded, by
renegotiating at the beginning of a new file transfer.

Abuse case : Client uploads a binary file, attacker injects binary code of his choice.

Resetting the TCP connection and injecting in mid transfer

According to Alun Jones11, a lot of FTP clients do not properly terminate the TLS Session.
Instead of sending a TLSshutdown messsage, the clients terminate the TCP session beneath
(RST,FIN), for this reason a lot of FTP servers have support for these border cases and do not
report these conneciton terminations as errors.

This however allows for a clever attack to be done. The Attacker can close the TCP connection
between the victim and the server by sending the specific TCP packet. The FTP client will the n
try to resume the upload using REST12 as the attacker (due to CCC) has access to this data he
exactly knows what part of the file the victim will resume and by renegotiation TLS he can


10
   http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzaiq/rzaiqserversubcommandccc.htm
11
   http://msmvps.com/blogs/alunj/default.aspx
12
   http://www.math.ntnu.no/mirror/www.qmail.org/koobera/www/ftp/retr.html
                                                                                                           19
TLS & SSLv3 renegotiation vulnerability 2011

prepend parts of the transfer. Additional the attacker may modify the REST command so that
the server resumes at the byte location he wants.




                                                                                       20
TLS & SSLv3 renegotiation vulnerability 2011

8. The Impact on other protocols using TLS
The impact of this vulnerability is different from one protocol to another. Several stateless
protocols like HTTP for instance, merge both sessions into one, making it possible for the
attacker to inject arbitrary plain text into the stream that is processed by the end stream as
coming from the same destination

This breaks a principal assumption made by application developers and has impacts on
innumerable number of custom implementations.

9.    Summary
     Protocol          Impact analysis available    Current status
     HTTPS             Yes                              1. Vulnerable to a certain degree,
                                                           impact depends on application level
                                                           logic and structure of the HTTP
                                                           requests.
                                                        2. If server supports TRACE command,
                                                           attacker can control the response
                                                        3. Attacker can downgrade to HTTP
                                                           (sslstrip)
     EAP-TLS           Online discussions13         Believed to not be vulnerable
     IMAPS             No                           Unknown
     POP3S             No                           Unknown
     LDAPS             No                           Unknown
     SMTPS             Yes                          Vulnerable only if certain requirements are
                                                    met
     FTPS              Yes                          Vulnerable - Further research required

     Application       Impact analysis available    Current status
     OpenVPN           Partially (vendor)           Not vulnerable, does not rely on openssl
                                                    session capabilities – session handling was
                                                    hardened after disclosure reports14
     Tomcat            Partially (vendor)           Vulnerable15 - mitigations exist
     Apache            Available                    Vulnerable – short term patch available16
     IIS 7 <=7.5       Available                    Vulnerable – not vulnerable to client initiated
                                                    renegotiation requests.
     GNUtls            Available                    Vulnerable – patch status unknown, IETF
                                                    proposal currently being implemented
     OpenSSL           Available                    Vulnerable – short term patches available

13
     http://www.ietf.org/mail-archive/web/tls/current/msg04109.html
14
     http://www.pubbs.net/openvpn/200911/19535/
15
     http://www.mail-archive.com/users@tomcat.apache.org/msg69335.html
16
     http://marc.info/?l=apache-httpd-announce&m=125755783724966&w=2
                                                                                                      21
TLS & SSLv3 renegotiation vulnerability 2011


Please refer to VU#120541 and BID36935 for an updated list of applications

EAP-TLS
EAP-TLS is not believed to be vulnerable if implemented as per specification17.

         There is no application layer protocol involved when EAP-TLS is executed
         Only the TLS key material is used, the tunnel is not used.
         EAP re-authentication not the same as TLS renegotiation which is executed in the
          previous TLS tunnel




17
     http://www.ietf.org/mail-archive/web/tls/current/msg04109.html
                                                                                       22
TLS & SSLv3 renegotiation vulnerability 2011

10.        Solutions
1. Proposed IETF solution
The IETF draft proposed by E. Rescorla, M. Ray, S. Dispensa, N. Oskov offers an elegant way to
solve the problem.

The Draft proposes a new TLS extension that cryptographically binds TLS sessions to clients and
further allows informing clients about renegotiations. Furthermore the proposed solution allows
working with a defined rule set that allows either - Never to renegotiate - Only renegotiate if TLS
negotiation extension is being used or Renegotiate anyways

As to our information all major vendors are currently implementing above proposed solution.


11.        Patching TLS
From the conditions that emerged in “Vulnerability conditions” the patching requirements
might be:

           Client
            Mid-term : Implement the IETF proposal for a TLS extension tracking and handling
             renegotiation requests18 (draft-rescorla-tls-renegotiation-00.txt)

           Server
            Short-term : Remove renegotiation capabilities altogether
            Mid-term : Implement the IETF proposal for a TLS extension tracking and handling
            renegotiation requests19 (draft-rescorla-tls-renegotiation-00.txt)

12.
  Patching SSLv3
The only way to fix the renegotiation vulnerability for SSLv3 is to disable renegotiation on the
server side completely. SSLv3 does not support extensions and as such cannot use the
proposed extension mentioned above.




18
     https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt
19
     https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt
                                                                                                23
TLS & SSLv3 renegotiation vulnerability 2011

13.       Testing for a renegotiation vulnerability
The toolset provided by Openssl20 offers the simplest way to test whether a server allows for
client-side renegotiation in the established tunnel. Note: This doesn’t necessarily mean that the
application beneath is vulnerable to attacks over this channel, but indicates the server allows
attacks to happen.

Vulnerability requirements
The preconditions for a TLS or SSLv3 connection to be vulnerable are

      1. The server acknowledges and accepts full TLS renegotiations in the middle of a
         connection and after the initial handshake
         and
      2. The server assumes that both TLS sessions were negotiated with the same client
         and
      3. The server treats both sessions as one and merges them at the application layer

As such this vulnerability might not been seen as a vulnerability in TLS but the as the bad choice
to merge two different requests together by the endpoint.

Generic Example

     Openssl s_client –connect yourserver.com:443
     GET / HTTP/1.0
     Host:yourserver.com
     R (Triggers renegotiation – if this works, the server accepts     renegotiations
     within an existing TLS session Req. #1)
     CRLF
     <server responds with content>             (server merged both sessions Req. #2)




Patched server with disabled renegotiation
     Openssl s_client –connect yourserver.com:443
     R (Triggers renegotiation)
     2860:error:1409444C:SSL routines:SSL3_READ_BYTES:tlsv1 alert no
     renegotiation:./ ssl/s3_pkt.c:1053:SSL alert number 100




20
     http://www.openssl.org/
                                                                                               24
TLS & SSLv3 renegotiation vulnerability 2011

14.      Conclusions
The vulnerability lies within the core of TLS and SSLv3, and will rear its ugly head for years to
come; the custom applications that are potentially vulnerable are innumerable.

Servers
       Servers that do allow mid-connection renegotiations are vulnerable
       Applications that handle 2 TLS sessions as coming from the same client are vulnerable
Clients
       Clients have no means (pre TLS extension) to check if a renegotiation is happening and
        are vulnerable

Sources
   1.    http://www.securityfocus.com/bid/36935
   2.    https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt
   3.    https://bugzilla.mozilla.org/show_bug.cgi?id=526689
   4.    http://blog.ivanristic.com/2009/11/ssl-and-tls-authentication-gap-vulnerability-discovered.html
   5.    http://www.leviathansecurity.com/pdf/ssltlstest.zip
   6.    http://extendedsubset.com/renegotiating_tls_20091104_pub.zip
   7.    https://bugzilla.redhat.com/show_bug.cgi?id=533125
   8.    http://www.mail-archive.com/users@tomcat.apache.org/msg69335.html
   9.    http://www.apache.org/dist/httpd/patches/apply_to_2.2.14/CVE-2009-3555-2.2.patch
   10.   http://sid.rstack.org/blog/index.php/373-tls-tout-le-monde-en-parle-pourquoi-pas-moi
   11.   https://www.mikestoolbox.net/
   12.   http://extendedsubset.com/
   13.   http://extendedsubset.com/Renegotiating_TLS.pdf
   14.   http://extendedsubset.com/Renegotiating_TLS_pd.pdf
   15.   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3555
   16.   http://www.chappellseminars.com/files/nutter-stevedispensa-sslgap.mp3
   17.   http://www.phonefactor.com/sslgap/ssl-tls-authentication-patches

Thanks
We would like to thank Marsh Ray, Alun Jones, Wietse Venema, Alexandre Dulaunoy, Noam
Rathaus, j.clausing and Simon Zuckerbraun.

15.      Disclaimer
Information is believed to be accurate by the time of writing. As this vulnerability is complex
this document may be prone to revisions in the future.




                                                                                                      25

Recommended

「Photon OS + Docker」VLAN 環境の構築 by
「Photon OS + Docker」VLAN 環境の構築「Photon OS + Docker」VLAN 環境の構築
「Photon OS + Docker」VLAN 環境の構築Fuva Brain
1.6K views15 slides
Converter 5.5を使ったP2V V2V by
Converter 5.5を使ったP2V V2VConverter 5.5を使ったP2V V2V
Converter 5.5を使ったP2V V2Vz2015026
29.4K views59 slides
[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 - by
[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -
[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -Shuji Kikuchi
10.5K views38 slides
OpenStackで始めるクラウド環境構築入門 by
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門VirtualTech Japan Inc.
34.5K views66 slides
AWS Organizations連携サービスの罠(Security JAWS 第26回 発表資料) by
AWS Organizations連携サービスの罠(Security JAWS 第26回 発表資料)AWS Organizations連携サービスの罠(Security JAWS 第26回 発表資料)
AWS Organizations連携サービスの罠(Security JAWS 第26回 発表資料)NTT DATA Technology & Innovation
745 views34 slides
Awsをオンプレドメコンに連携させる by
Awsをオンプレドメコンに連携させるAwsをオンプレドメコンに連携させる
Awsをオンプレドメコンに連携させるSyuichi Murashima
5.2K views41 slides

More Related Content

What's hot

[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요 by
[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요
[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요Jo Hoon
2.1K views44 slides
Network Access Control (NAC) by
Network Access Control (NAC)Network Access Control (NAC)
Network Access Control (NAC)Forescout Technologies Inc
5.1K views13 slides
30分でRHEL6 High Availability Add-Onを超絶的に理解しよう! by
30分でRHEL6 High Availability Add-Onを超絶的に理解しよう!30分でRHEL6 High Availability Add-Onを超絶的に理解しよう!
30分でRHEL6 High Availability Add-Onを超絶的に理解しよう!Etsuji Nakai
20.8K views23 slides
初心者向けWebinar AWSで開発環境を構築しよう by
初心者向けWebinar AWSで開発環境を構築しよう初心者向けWebinar AWSで開発環境を構築しよう
初心者向けWebinar AWSで開発環境を構築しようAmazon Web Services Japan
29.5K views69 slides
10分でわかる Cilium と XDP / BPF by
10分でわかる Cilium と XDP / BPF10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPFShuji Yamada
12K views20 slides
OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月 by
OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月
OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月VirtualTech Japan Inc.
17.3K views92 slides

What's hot(20)

[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요 by Jo Hoon
[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요
[네전따] 네트워크 엔지니어에게 쿠버네티스는 어떤 의미일까요
Jo Hoon2.1K views
30分でRHEL6 High Availability Add-Onを超絶的に理解しよう! by Etsuji Nakai
30分でRHEL6 High Availability Add-Onを超絶的に理解しよう!30分でRHEL6 High Availability Add-Onを超絶的に理解しよう!
30分でRHEL6 High Availability Add-Onを超絶的に理解しよう!
Etsuji Nakai20.8K views
10分でわかる Cilium と XDP / BPF by Shuji Yamada
10分でわかる Cilium と XDP / BPF10分でわかる Cilium と XDP / BPF
10分でわかる Cilium と XDP / BPF
Shuji Yamada12K views
OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月 by VirtualTech Japan Inc.
OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月
OpenStack検証環境構築・トラブルシューティング入門 - OpenStack最新情報セミナー 2014年8月
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回) by Masaya Tahara
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
Masaya Tahara934 views
Active Directoryに公開したプリンタを解除 by Michio Koyama
Active Directoryに公開したプリンタを解除Active Directoryに公開したプリンタを解除
Active Directoryに公開したプリンタを解除
Michio Koyama3.5K views
Db2をAWS上に構築する際のヒント&TIPS 2019年7月版 by Akira Shimosako
Db2をAWS上に構築する際のヒント&TIPS 2019年7月版Db2をAWS上に構築する際のヒント&TIPS 2019年7月版
Db2をAWS上に構築する際のヒント&TIPS 2019年7月版
Akira Shimosako15.8K views
AWS導入から3年 AWSマルチアカウント管理で変わらなかったこと変えていったこと by Takayuki Ishikawa
AWS導入から3年 AWSマルチアカウント管理で変わらなかったこと変えていったことAWS導入から3年 AWSマルチアカウント管理で変わらなかったこと変えていったこと
AWS導入から3年 AWSマルチアカウント管理で変わらなかったこと変えていったこと
Takayuki Ishikawa3.3K views
「おうちクラウド」が今熱い! by Hirotaka Sato
「おうちクラウド」が今熱い!「おうちクラウド」が今熱い!
「おうちクラウド」が今熱い!
Hirotaka Sato1K views
flaws.cloudに挑戦しよう! by zaki4649
flaws.cloudに挑戦しよう!flaws.cloudに挑戦しよう!
flaws.cloudに挑戦しよう!
zaki46499.8K views
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축 by Ji-Woong Choi
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
Ji-Woong Choi4.6K views
あなたも「違いが分かる人」になりましょう! ~ Azure, AzureStack, AzureStack HCI ~ by Masahiko Ebisuda
あなたも「違いが分かる人」になりましょう! ~ Azure, AzureStack, AzureStack HCI ~あなたも「違いが分かる人」になりましょう! ~ Azure, AzureStack, AzureStack HCI ~
あなたも「違いが分かる人」になりましょう! ~ Azure, AzureStack, AzureStack HCI ~
Masahiko Ebisuda4.9K views
Amazon Kinesis Video Streams WebRTC 使ってみた by mganeko
Amazon Kinesis Video Streams WebRTC 使ってみたAmazon Kinesis Video Streams WebRTC 使ってみた
Amazon Kinesis Video Streams WebRTC 使ってみた
mganeko6.9K views

Similar to The TLS/SSLv3 renegotiation vulnerability explained

TLS and SSL v3 vulnerabilities by
TLS and SSL v3 vulnerabilitiesTLS and SSL v3 vulnerabilities
TLS and SSL v3 vulnerabilitiesKim Jensen
4.6K views25 slides
Bounty bout 0x01 - WebRTC edition by
Bounty bout 0x01 - WebRTC editionBounty bout 0x01 - WebRTC edition
Bounty bout 0x01 - WebRTC editionSandro Gauci
101 views16 slides
Improved kernel based port-knocking in linux by
Improved kernel based port-knocking in linuxImproved kernel based port-knocking in linux
Improved kernel based port-knocking in linuxdinomasch
813 views66 slides
Performance assessment of the MASQUE extension for proxying scenarios in the ... by
Performance assessment of the MASQUE extension for proxying scenarios in the ...Performance assessment of the MASQUE extension for proxying scenarios in the ...
Performance assessment of the MASQUE extension for proxying scenarios in the ...AlessandroNuzzi1
164 views72 slides
thesis_template by
thesis_templatethesis_template
thesis_templateRuslan Kovalov
196 views60 slides
Maharastra CCN NetSim Experiment Manual by
Maharastra CCN  NetSim Experiment  ManualMaharastra CCN  NetSim Experiment  Manual
Maharastra CCN NetSim Experiment ManualDr Praveen Jain
347 views200 slides

Similar to The TLS/SSLv3 renegotiation vulnerability explained(20)

TLS and SSL v3 vulnerabilities by Kim Jensen
TLS and SSL v3 vulnerabilitiesTLS and SSL v3 vulnerabilities
TLS and SSL v3 vulnerabilities
Kim Jensen4.6K views
Bounty bout 0x01 - WebRTC edition by Sandro Gauci
Bounty bout 0x01 - WebRTC editionBounty bout 0x01 - WebRTC edition
Bounty bout 0x01 - WebRTC edition
Sandro Gauci101 views
Improved kernel based port-knocking in linux by dinomasch
Improved kernel based port-knocking in linuxImproved kernel based port-knocking in linux
Improved kernel based port-knocking in linux
dinomasch813 views
Performance assessment of the MASQUE extension for proxying scenarios in the ... by AlessandroNuzzi1
Performance assessment of the MASQUE extension for proxying scenarios in the ...Performance assessment of the MASQUE extension for proxying scenarios in the ...
Performance assessment of the MASQUE extension for proxying scenarios in the ...
AlessandroNuzzi1164 views
Maharastra CCN NetSim Experiment Manual by Dr Praveen Jain
Maharastra CCN  NetSim Experiment  ManualMaharastra CCN  NetSim Experiment  Manual
Maharastra CCN NetSim Experiment Manual
Dr Praveen Jain347 views
Secure shell performance testing by Sami Knuutinen
Secure shell performance testingSecure shell performance testing
Secure shell performance testing
Sami Knuutinen575 views
RCD_FL.doc by oynindim
RCD_FL.docRCD_FL.doc
RCD_FL.doc
oynindim11 views
Networking principles protocols and practice by DAVID RAUDALES
Networking principles protocols and practiceNetworking principles protocols and practice
Networking principles protocols and practice
DAVID RAUDALES106 views
B12303 by rajuuuu
B12303B12303
B12303
rajuuuu1K views
IPsec vpn topology over GRE tunnels by Mustafa Khaleel
IPsec vpn topology over GRE tunnelsIPsec vpn topology over GRE tunnels
IPsec vpn topology over GRE tunnels
Mustafa Khaleel1.2K views
Study and analysis of some known attacks on transport layer security by Nazmul Hossain Rakib
Study and analysis of some known attacks on transport layer securityStudy and analysis of some known attacks on transport layer security
Study and analysis of some known attacks on transport layer security
Sybase Adaptive Server Anywhere for Linux by marcorinco
Sybase Adaptive Server Anywhere for LinuxSybase Adaptive Server Anywhere for Linux
Sybase Adaptive Server Anywhere for Linux
marcorinco307 views
Black berry playbook security part one by Yury Chemerkin
Black berry playbook security   part oneBlack berry playbook security   part one
Black berry playbook security part one
Yury Chemerkin2.3K views
Tems investigation 13.1 release note by telecom_200
Tems investigation 13.1 release noteTems investigation 13.1 release note
Tems investigation 13.1 release note
telecom_20014.2K views
Draft Hammer Oauth 10 by Vishal Shah
Draft Hammer Oauth 10Draft Hammer Oauth 10
Draft Hammer Oauth 10
Vishal Shah3.3K views
F5 Networks Threat Analysis: Madness by F5 Networks
F5 Networks Threat Analysis: MadnessF5 Networks Threat Analysis: Madness
F5 Networks Threat Analysis: Madness
F5 Networks1.1K views
16.7_Release_Notes.pdf by AbhySingh3
16.7_Release_Notes.pdf16.7_Release_Notes.pdf
16.7_Release_Notes.pdf
AbhySingh399 views

More from Thierry Zoller

BLtouch marlin configuration by
BLtouch marlin configurationBLtouch marlin configuration
BLtouch marlin configurationThierry Zoller
896 views5 slides
Neo coolcam - smart-plug user guide v2 - Zwave by
Neo coolcam  - smart-plug user guide v2 - ZwaveNeo coolcam  - smart-plug user guide v2 - Zwave
Neo coolcam - smart-plug user guide v2 - ZwaveThierry Zoller
10.2K views10 slides
Cansecwest - The Death of AV defence in depth by
Cansecwest - The Death of AV defence in depthCansecwest - The Death of AV defence in depth
Cansecwest - The Death of AV defence in depthThierry Zoller
860 views47 slides
Heise Security - Scheunentor Bluetooth by
Heise Security - Scheunentor BluetoothHeise Security - Scheunentor Bluetooth
Heise Security - Scheunentor BluetoothThierry Zoller
529 views44 slides
23c3 Bluetooth hacking revisited by
23c3 Bluetooth hacking revisited23c3 Bluetooth hacking revisited
23c3 Bluetooth hacking revisitedThierry Zoller
823 views41 slides
Hack.lu 2006 - All your Bluetooth is belong to us by
Hack.lu 2006 - All your Bluetooth is belong to usHack.lu 2006 - All your Bluetooth is belong to us
Hack.lu 2006 - All your Bluetooth is belong to usThierry Zoller
314 views51 slides

More from Thierry Zoller(11)

BLtouch marlin configuration by Thierry Zoller
BLtouch marlin configurationBLtouch marlin configuration
BLtouch marlin configuration
Thierry Zoller896 views
Neo coolcam - smart-plug user guide v2 - Zwave by Thierry Zoller
Neo coolcam  - smart-plug user guide v2 - ZwaveNeo coolcam  - smart-plug user guide v2 - Zwave
Neo coolcam - smart-plug user guide v2 - Zwave
Thierry Zoller10.2K views
Cansecwest - The Death of AV defence in depth by Thierry Zoller
Cansecwest - The Death of AV defence in depthCansecwest - The Death of AV defence in depth
Cansecwest - The Death of AV defence in depth
Thierry Zoller860 views
Heise Security - Scheunentor Bluetooth by Thierry Zoller
Heise Security - Scheunentor BluetoothHeise Security - Scheunentor Bluetooth
Heise Security - Scheunentor Bluetooth
Thierry Zoller529 views
23c3 Bluetooth hacking revisited by Thierry Zoller
23c3 Bluetooth hacking revisited23c3 Bluetooth hacking revisited
23c3 Bluetooth hacking revisited
Thierry Zoller823 views
Hack.lu 2006 - All your Bluetooth is belong to us by Thierry Zoller
Hack.lu 2006 - All your Bluetooth is belong to usHack.lu 2006 - All your Bluetooth is belong to us
Hack.lu 2006 - All your Bluetooth is belong to us
Thierry Zoller314 views
Managing Application Security Risk in Enterprises - Thoughts and recommendations by Thierry Zoller
Managing Application Security Risk in Enterprises - Thoughts and recommendationsManaging Application Security Risk in Enterprises - Thoughts and recommendations
Managing Application Security Risk in Enterprises - Thoughts and recommendations
Thierry Zoller200 views
All your Bluetooth is belong to us - the rest too. by Thierry Zoller
All your Bluetooth is belong to us - the rest too.All your Bluetooth is belong to us - the rest too.
All your Bluetooth is belong to us - the rest too.
Thierry Zoller248 views
IPV6 - Threats and Countermeasures / Crash Course by Thierry Zoller
IPV6 - Threats and Countermeasures / Crash CourseIPV6 - Threats and Countermeasures / Crash Course
IPV6 - Threats and Countermeasures / Crash Course
Thierry Zoller1.1K views
The Rise of the Vulnerability Markets - History, Impacts, Mitigations - Thier... by Thierry Zoller
The Rise of the Vulnerability Markets - History, Impacts, Mitigations - Thier...The Rise of the Vulnerability Markets - History, Impacts, Mitigations - Thier...
The Rise of the Vulnerability Markets - History, Impacts, Mitigations - Thier...
Thierry Zoller272 views
SSL Audit - The SSL / TLS Scanner by Thierry Zoller
SSL Audit -  The SSL / TLS ScannerSSL Audit -  The SSL / TLS Scanner
SSL Audit - The SSL / TLS Scanner
Thierry Zoller1.6K views

Recently uploaded

Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...ShapeBlue
74 views17 slides
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...ShapeBlue
69 views29 slides
MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
39 views8 slides
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesShapeBlue
178 views15 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
54 views27 slides
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...ShapeBlue
114 views12 slides

Recently uploaded(20)

Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue74 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue69 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue178 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty54 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue114 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue68 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue75 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue138 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue59 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue191 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE67 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue147 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue110 views
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue58 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10110 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue128 views

The TLS/SSLv3 renegotiation vulnerability explained

  • 1. TLS / SSLv3 renegotiation vulnerability explained Thierry ZOLLER contact@g-sec.lu http://www.g-sec.lu http://blog.zoller.lu G-SEC™ is a non-commercial and independent group of Information Security Specialists based in Luxembourg.
  • 2. TLS & SSLv3 renegotiation vulnerability 2011 1. Table of Contents 2. Synopsis ........................................................................................................................................... 3 3. Revisions .......................................................................................................................................... 4 4. Generic TLS renegotiation prefix injection vulnerability .................................................................... 5 4.1. Details ...................................................................................................................................... 6 5. HTTPS .............................................................................................................................................. 7 5.1. First method - Injecting commands into an HTTPS session ........................................................ 8 5.2. Details ...................................................................................................................................... 9 5.3. Second method - HTTPS to HTTP downgrade attack................................................................ 10 5.4. Details .................................................................................................................................... 11 5.5. Third method - Injecting custom responses through TRACE .................................................... 12 5.6. Details .................................................................................................................................... 13 6. SMTPS ............................................................................................................................................ 14 Protocol vulnerability matrix .............................................................................................................. 14 The attacker does NOT have an account on the SMTP server ......................................................... 14 The Attacker has an account on the SMTP server ........................................................................... 14 Attack scenario - SMTP STARTTLS (110) .............................................................................................. 15 Details................................................................................................................................................ 16 Client side attack detection ................................................................................................................ 17 Important Note .................................................................................................................................. 17 7. FTPS ............................................................................................................................................... 18 Client certificate based authentication (Control Channel)................................................................... 19 Renegotiations due to NAT support (Data Channel) ........................................................................... 19 Resetting the TCP connection and injecting in mid transfer ................................................................ 19 8. The Impact on other protocols using TLS ........................................................................................ 21 9. Summary........................................................................................................................................ 21 EAP-TLS .............................................................................................................................................. 22 10. Solutions ........................................................................................................................................ 23 1. Proposed IETF solution ............................................................................................................... 23 11. Patching TLS ................................................................................................................................... 23 Client ............................................................................................................................................. 23 Server ............................................................................................................................................ 23 2
  • 3. TLS & SSLv3 renegotiation vulnerability 2011 12. Patching SSLv3 ............................................................................................................................... 23 13. Testing for a renegotiation vulnerability ......................................................................................... 24 Vulnerability requirements ................................................................................................................ 24 Generic Example ................................................................................................................................ 24 Patched server with disabled renegotiation ....................................................................................... 24 14. Conclusions .................................................................................................................................... 25 Servers............................................................................................................................................... 25 Clients................................................................................................................................................ 25 Sources .............................................................................................................................................. 25 Thanks ............................................................................................................................................... 25 15. Disclaimer ...................................................................................................................................... 25 2. Synopsis Around the 09/11/2009 Marsh Ray, Steve Dispensa and Martin Rex published details1 about a vulnerability affecting the TLS and the SSLv3 protocol. The vulnerability is being tracked under CVE-2009-35552 | VU#1205413 and affects a multitude of platforms and protocols, the impact of this vulnerability varies from protocol to protocol and from application to application. There is extensive research required in order to assess When speaking of a “Man in the Middle” attack, it is often assumed that data can be altered or changed. Indeed an attacker that sits in the middle of a connection (hence it’s name) is often able to do so. In this particular case however the attacker piggybacks an existing authenticated and encrypted TLS sessions in order to (prefix) inject arbitrary text of its choice. The attacker may not read/alter the other TLS session between the “client” and the “server”. This paper explains the vulnerability for a broader audience and summarizes the information that is currently available. The document is prone to updates and is believed to be accurate by the time of writing. Important: This vulnerability is not limited to HTTPS, this vulnerability potentially affects every application/protocol that implements TLS or SSLv3. This paper is referenced by the US-CERT, DFN-CERT, BELNET-CERT, SWITCH-cert,Nessus, Qualys, c't Heise, and many more. Furthermore it has served as a internal Training paper for a major OS vendor. 1 http://www.extendedsubset.com/ 2 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3555 3 http://www.kb.cert.org/vuls/id/120541 3
  • 4. TLS & SSLv3 renegotiation vulnerability 2011 3. Revisions Version Date Annotations 0.8 09.11.2009 Initial draft 0.81 10.11.2009 Adding general and specific example 0.9 12.11.2009 Added vulnerability requirements, protocol overview 0.91 12.11.2009 Initial public draft release at http://www.g-sec.lu/ 0.92 13.11.2009 Corrected few errors 0.93 17.11.2009 Added test cases and SMTP over TLS details 0.95 24.11.2009 Added FTPS details, fixed syntax and formatting errors, added IIS7 clarifications 0.96 25.11.2009 New test cases 0.97 27.11.2009 Added HTTPS TRACE and HTTPS to HTTP downgrade attack 0.98 29.11.2009 Added 2 POC files for the TRACE and HTTPS to HTTP downgrade attack 0.99 22.12.2011 Added the correction sent in by Alun Jones 1.0 23.12.2011 Grammar, Better PDF support, release of Final version 4
  • 5. TLS & SSLv3 renegotiation vulnerability 2011 4. Generic TLS renegotiation prefix injection vulnerability 5
  • 6. TLS & SSLv3 renegotiation vulnerability 2011 4.1. Details 1 “Client” starts the TLS handshake – Attacker does not forward these immediately 1.1 The attacker negotiates a new session performs a full TLS exchange 1.2 The attacker sends application level commands over the previously established TLS session (#2) 2 Renegotiation is triggered either 1. because of Certificate based auth (server sees get /dir and decides it needs an certificate for „directory“) 2. due to different cipher requriements on different ressources (Server initiated) 3. by the client 3 The TLS handshake started at 1 and hold back by the attacker, is now being let to the server which performs a new TLS Handshake over the previously established encrypted TLS session #2 (Attacker<>Server) 4 The TLS endpoint, due to the renegotiation has to take into the account the previously sent data (per spec), the endpoint believes the previous data (1.2) to have been send from the same client. As such this request is prefixed to the one issued by the client in 4 (See HTTPS example for a more explicit example) 6
  • 7. TLS & SSLv3 renegotiation vulnerability 2011 5. HTTPS There are multiple ways to abuse HTTPS in order to inject traffic into an authenticated stream. An additional attack vector was uncovered by Frank Heidt (Leviathan Security) but not published and rediscovered by Thierry Zoller (G-SEC) for this paper, this vector allows downgrading an existing SSL session to plain text. This paper will present 2 new methods to leverage the TLS renegotiation vulnerability 1. Injecting plaintext and abusing using X-Ignore:/n (Marsh Ray) or using unfinished POST to a web application reflecting content (Anil Kurmus) Summary: The attacker injects (prepends) GET/POST HTTP commands and does not terminate the last command (i.e no CRLF) that way when both http requests (Attacker, Victim) merge, part of the victim requests are ignored) 2. Downgrading from HTTPS to HTTP and performing active Man-in-the-Middle – according to an online article this was discovered by Frank Heidt but choosen not to disclose4 the details; details have been rediscovered for this paper by Thierry Zoller (G- SEC) Summary: The attacker injects (prepend) a HTTP request to a resource reachable over SSL but redirecting the client to HTTP when requested. Such behavior is a common occurrence. 3. “When TRACE comes back to bite you” – After ideas to use TRACE method to leverage this flaw appeared in twitter (olle@toolcrypt.org and sirdarckcat) this method was researched and turned into a POC by Thierry Zoller. Summary: The attacker injects a TRACE command, by doing so the attacker can control the content that is send from the server to the victim over HTTPS 4 http://www.pcworld.com/article/182720/security_pro_says_new_ssl_attack_can_hit_many_sites.html 7
  • 8. TLS & SSLv3 renegotiation vulnerability 2011 5.1. First method - Injecting commands into an HTTPS session 8
  • 9. TLS & SSLv3 renegotiation vulnerability 2011 5.2. Details This is one example of how this vulnerability might be used to affect HTTPS. We are aware that in this case a simple XSRF5 attack could have achieved the same effect, however this is a easy to understand example. This attack can be used to abuse specific features of the affected web application, for example a POC has been demonstrated on how to steal Twitter credentials using this flaw6. 1.1 The attacker negotiates a new session performs a full TLS exchange The attacker sends a GET request to a fictional weak e-banking application. Note that 1.2 the attacker can add multiple requests due to HTTP1.1 pipelining but that only the last request usurps the cookie. 2 Renegotiation is triggered The TLS handshake started at 1 and hold back by the attacker, is now being let to 3 the server which performs a new TLS Handshake over the previously established encrypted TLS session #2 (Attacker<>Server) The TLS endpoint, due to the renegotiation has to take into the account the previously sent data (per spec), the endpoint believes the previous data (1.2) to have been send from the same client The requests 1.2 : Attacker -> server GET /ebanking/ paymemoney.cgi?acc=LU00000000000000?amount=1000 Ignore-what-comes-now: And 4: Client->server GET /ebanking Cookie: AS21389:6812HSADI:3991238 The request is prefixed to the request issued by the client in (4) and is merged into GET /ebanking/ paymemoney.cgi?acc=LU00000000000000?amount=1000 Ignore-what-comes-now: GET /ebanking Cookie: AS21389:6812HSADI:3991238 Interpreted by the HTTP daemon as : GET /ebanking/ paymemoney.cgi?acc=LU00000000000000?amount=1000 Cookie: AS21389:6812HSADI:3991238 5 http://en.wikipedia.org/wiki/Cross-Site_Request_Forgery 6 http://www.securegoose.org/2009/11/tls-renegotiation-vulnerability-cve.html 9
  • 10. TLS & SSLv3 renegotiation vulnerability 2011 5.3.Second method - HTTPS to HTTP downgrade attack 10
  • 11. TLS & SSLv3 renegotiation vulnerability 2011 5.4. Details 7 SSLstrip is a tool presented by Marlin Spikes at Blackhat 2009 - it allows to perform an active MITM attack by stripping of SSL from the connection of the victim. The attack had one particular drawback: it was not possible to downgrade an existing SSL session, and only worked if the user accesses his bank over HTTP first then trying to submit his credentials to HTTPS. Abusing the TLS renegotiation vulnerability however it is now possible to even apply SSLstrip to established SSL connections. The Proof of concept for this attack can be found at : http://www.g-sec.lu/tls-ssl-proof-of- concept.html 1.2 The attacker sends a GET request he knows will redirect the HTTP client to a non HTTPS page on the server. 2 Renegotiation is triggered The TLS handshake started at 1 and hold back by the attacker, is now being let to 3 the server which performs a new TLS Handshake over the previously established encrypted TLS session #2 (Attacker<>Server) The TLS endpoint, due to the renegotiation has to take into the account the previously sent data (per spec), The request is prefixed to the request issued by the client in (4) and is merged into one request. The attacker effectively replaced the GET request. The server replies with a 302 redirecting the victim to an HTTP page The HTTP browser of the victim automatically follows the redirect the server has sent and requests the HTTP page. The attacker is now seeing the clear text requests and can rewrite the HTTP request from the victim to his liking – from this point on the attacker continues the attack with SSLtrip 7 http://www.thoughtcrime.org/software/sslstrip/ 11
  • 12. TLS & SSLv3 renegotiation vulnerability 2011 5.5. Third method - Injecting custom responses through TRACE 12
  • 13. TLS & SSLv3 renegotiation vulnerability 2011 5.6. Details TRACE allows the attacker to control the response from the server to the client, contrary to the original attack that only allowed controlling the request to the server, using trace gives control over the response (within certain limits). At the moment is believed that TRACE is unlikely to be used to execute client-side javascript code, this is due to the “content-type:message/http” header the servers adds to the response and prompts the browser to initiate a download. Binary content injection through TRACE also appears not to be possible as the filename the browser saves the data into is not controlled by the attacker. There are several third-party browsers that use own sockets to send/receive http data and use the TRIDENT engine (mshtml.dll) to render the WebPages. These implementations are vulnerable to JavaScript injection. The reason is that the IE component does not see the HTTP header and renders that data as if it would be HTML. The TRACE method can also be abused for example in situations where custom code is used that ignores the content-type and just parses for specific data. For instance one can imagine that several automatic updates protocols and server to server communications are vulnerable to this attack. As the client expects a response to a GET request it is likely that developers have not spend time to look into whether the response really comes from a GET request. Summary: The attacker injects a TRACE command, by doing so the attacker can control the content that is send from the server to the victim over HTTPS The Proof of concept for this attack can be found at : http://www.g-sec.lu/tls-ssl-proof-of- concept.html 13
  • 14. TLS & SSLv3 renegotiation vulnerability 2011 6. SMTPS There are 2 major ways to use TLS with SMTP – STARTTLS and TLS from the beginning. With STARTTLS you connect to the SMTP port using plain text and then request a TLS connection using the command “STARTTLS”. T. ZOLLER (G-SEC) as well as W.VENEMA (Postfix) have researched this protocol independently, the following represents a summary of what is currently known. VENEMA has published a PDF that summarizes his views8. Discussions with M. VENEMA resulted in the following information based attacks in-line with protocol requirements. A successful attack requires an SMTP server that uses a TLS engine that reads the data as soon as it arrives, vendors are required to assess the products in order to determine if their product is vulnerable. Currently there are no independant research results for SMTP. As an example of software that uses TLS engine in a way required for these attacks to work, VENEMA cited STUNNEL. Protocol vulnerability matrix The following information is believed to be correct by the time of writing The attacker does NOT have an account on the SMTP server Attack theoretically possible if TLS private cert authentication without SASL SMTP over TLS without SASL The Attacker has an account on the SMTP server Attack theoretically possible if TLS private cert authentication without SASL TLS private cert authentication with SASL SMTP over TLS with SASL SMTP over TLS without SASL 8 http://www.porcupine.org/postfix-mirror/smtp-renegotiate.pdf 14
  • 15. TLS & SSLv3 renegotiation vulnerability 2011 Attack scenario - SMTP STARTTLS (110) 15
  • 16. TLS & SSLv3 renegotiation vulnerability 2011 Details This is a complex example of how this vulnerability could be used to exploit SMTP over TLS (STARTSSL) if the attacker has an account 1 Attacker connects to the SMTP server and initiates a TLS session (STARTTLS) 1.1 The attacker negotiates a new session performs a full TLS exchange 1.2 The attacker sends SMTP commands to the server but does not end the SMTP session, in this example the attacker controls the source and destination e-mail addresses. 2 Renegotiation is triggered Attacker initiates a TLS session (TLS HELLO) and the victim performs a new TLS 3 Handshake over the previously established encrypted TLS session #2 (Attacker<>Server) The TLS endpoint, due to the renegotiation has to take into the account the previously sent data (per spec), the endpoint believes the previous data (1.2) to have been send from the same client As such the client now receives the answers from the attacker injected commands (note this is a way to detect this attack on the client-side). The victim SMTP client now issues his commands to send mail – Those commands end up in the BODY of the mail previously started by the attacker. The SMTP server receives: EHLO whatever AUTH PLAIN whatever MAIL FROM:<attacker-chosen-sender> RCPT TO:<attacker-chosen-recipient> attacker:DATA victim:EHLO victim:AUTH PLAIN whatever victim:MAIL FROM victim:whatever victiim:DATA<crlf> As such the :<attacker-chosen-recipient> receives a mail containing the authentication data aswell as the other data. 16
  • 17. TLS & SSLv3 renegotiation vulnerability 2011 Client side attack detection Contrary to HTTPS protocol the client has a way to detect that he was attacked at the application layer as the server replies arrive before the victim even sent the commands. Important Note To our knowledge POSTFIX is not affected by this vulnerability. 17
  • 18. TLS & SSLv3 renegotiation vulnerability 2011 7. FTPS FTPS is a SSL/TLS based implementation of FTP, it is not to be confused with SFTP (Alun Jones: “SFTP is a completely different protocol – a sub-protocol of SSH. For example, where FTP uses commands of three or four letters, SFTP uses binary single byte instructions.”). Alun Jones 9 author of WFTPD has done an impact analysis on FTPS implementations and the potential vulnerabilities that might be present, the analysis contains an interesting note about degrading encryption for sake of NAT compatibility which has impact beyond the TLS/SSL renegotiation vulnerability. FTPS is particularly interesting because it has two channels, the CONTROL channel and the DATA channel which can be requested to be encrypted separately. Please refer to the description at http://www.allaboutjake.com/network/linksys/ftp/ for more insight into FTP connections. The following information is believed to be correct by the time of writing; the bespoken possible vulnerabilities are depended on specific FTP client and FTP server implementations. Vendors need to look into these particular implementations and fix them accordingly. 9 http://msmvps.com/blogs/alunj/default.aspx 18
  • 19. TLS & SSLv3 renegotiation vulnerability 2011 Client certificate based authentication (Control Channel) Contrary to HTTPS, FTPS Client-certificate based auth is unlikely to be vulnerable. Indeed HTTPS client certificate based authentication it is vulnerable due to a particular circumstance being the necessity to receive a particular request to a directory prior to choosing whether a certificate is required or not, the HTTP server then needs to renegotiate. This is not the case with FTPS, the connection is encrypted from the very start or it isn’t, it is unlikely the server supports renegotiation at that point. “FTPS resets the command state and commands are executed in the context that existed at that time, rather than the newly- authenticated context.” Renegotiations due to NAT support (Data Channel) NAT devices need to keep track of connections and have support to rewrite FTP connections on the fly in order to allow FTP to work over NAT. The problem that appeared with FTPS is that the NAT devices could not peek into the PASV or PORT commands any longer and as such would not be able to NAT FTP. Because of this and to be able to offer FTPS over NAT, several vendors added support for the CCC 10command (Clear Command Channel). The FTP server will drop the secure connection in order for the NAT device to be able to rewrite PASV and PORT commands. This allows the attacker to see the control channel in clear text. This allows the attacker to know WHEN and WHAT files are currently being transferred, if the server accepts TLS renegotiations the attacker might then, timed to the clear text control channel, inject data into files being uploaded, by renegotiating at the beginning of a new file transfer. Abuse case : Client uploads a binary file, attacker injects binary code of his choice. Resetting the TCP connection and injecting in mid transfer According to Alun Jones11, a lot of FTP clients do not properly terminate the TLS Session. Instead of sending a TLSshutdown messsage, the clients terminate the TCP session beneath (RST,FIN), for this reason a lot of FTP servers have support for these border cases and do not report these conneciton terminations as errors. This however allows for a clever attack to be done. The Attacker can close the TCP connection between the victim and the server by sending the specific TCP packet. The FTP client will the n try to resume the upload using REST12 as the attacker (due to CCC) has access to this data he exactly knows what part of the file the victim will resume and by renegotiation TLS he can 10 http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzaiq/rzaiqserversubcommandccc.htm 11 http://msmvps.com/blogs/alunj/default.aspx 12 http://www.math.ntnu.no/mirror/www.qmail.org/koobera/www/ftp/retr.html 19
  • 20. TLS & SSLv3 renegotiation vulnerability 2011 prepend parts of the transfer. Additional the attacker may modify the REST command so that the server resumes at the byte location he wants. 20
  • 21. TLS & SSLv3 renegotiation vulnerability 2011 8. The Impact on other protocols using TLS The impact of this vulnerability is different from one protocol to another. Several stateless protocols like HTTP for instance, merge both sessions into one, making it possible for the attacker to inject arbitrary plain text into the stream that is processed by the end stream as coming from the same destination This breaks a principal assumption made by application developers and has impacts on innumerable number of custom implementations. 9. Summary Protocol Impact analysis available Current status HTTPS Yes 1. Vulnerable to a certain degree, impact depends on application level logic and structure of the HTTP requests. 2. If server supports TRACE command, attacker can control the response 3. Attacker can downgrade to HTTP (sslstrip) EAP-TLS Online discussions13 Believed to not be vulnerable IMAPS No Unknown POP3S No Unknown LDAPS No Unknown SMTPS Yes Vulnerable only if certain requirements are met FTPS Yes Vulnerable - Further research required Application Impact analysis available Current status OpenVPN Partially (vendor) Not vulnerable, does not rely on openssl session capabilities – session handling was hardened after disclosure reports14 Tomcat Partially (vendor) Vulnerable15 - mitigations exist Apache Available Vulnerable – short term patch available16 IIS 7 <=7.5 Available Vulnerable – not vulnerable to client initiated renegotiation requests. GNUtls Available Vulnerable – patch status unknown, IETF proposal currently being implemented OpenSSL Available Vulnerable – short term patches available 13 http://www.ietf.org/mail-archive/web/tls/current/msg04109.html 14 http://www.pubbs.net/openvpn/200911/19535/ 15 http://www.mail-archive.com/users@tomcat.apache.org/msg69335.html 16 http://marc.info/?l=apache-httpd-announce&m=125755783724966&w=2 21
  • 22. TLS & SSLv3 renegotiation vulnerability 2011 Please refer to VU#120541 and BID36935 for an updated list of applications EAP-TLS EAP-TLS is not believed to be vulnerable if implemented as per specification17.  There is no application layer protocol involved when EAP-TLS is executed  Only the TLS key material is used, the tunnel is not used.  EAP re-authentication not the same as TLS renegotiation which is executed in the previous TLS tunnel 17 http://www.ietf.org/mail-archive/web/tls/current/msg04109.html 22
  • 23. TLS & SSLv3 renegotiation vulnerability 2011 10. Solutions 1. Proposed IETF solution The IETF draft proposed by E. Rescorla, M. Ray, S. Dispensa, N. Oskov offers an elegant way to solve the problem. The Draft proposes a new TLS extension that cryptographically binds TLS sessions to clients and further allows informing clients about renegotiations. Furthermore the proposed solution allows working with a defined rule set that allows either - Never to renegotiate - Only renegotiate if TLS negotiation extension is being used or Renegotiate anyways As to our information all major vendors are currently implementing above proposed solution. 11. Patching TLS From the conditions that emerged in “Vulnerability conditions” the patching requirements might be: Client  Mid-term : Implement the IETF proposal for a TLS extension tracking and handling renegotiation requests18 (draft-rescorla-tls-renegotiation-00.txt) Server  Short-term : Remove renegotiation capabilities altogether  Mid-term : Implement the IETF proposal for a TLS extension tracking and handling renegotiation requests19 (draft-rescorla-tls-renegotiation-00.txt) 12. Patching SSLv3 The only way to fix the renegotiation vulnerability for SSLv3 is to disable renegotiation on the server side completely. SSLv3 does not support extensions and as such cannot use the proposed extension mentioned above. 18 https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt 19 https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt 23
  • 24. TLS & SSLv3 renegotiation vulnerability 2011 13. Testing for a renegotiation vulnerability The toolset provided by Openssl20 offers the simplest way to test whether a server allows for client-side renegotiation in the established tunnel. Note: This doesn’t necessarily mean that the application beneath is vulnerable to attacks over this channel, but indicates the server allows attacks to happen. Vulnerability requirements The preconditions for a TLS or SSLv3 connection to be vulnerable are 1. The server acknowledges and accepts full TLS renegotiations in the middle of a connection and after the initial handshake and 2. The server assumes that both TLS sessions were negotiated with the same client and 3. The server treats both sessions as one and merges them at the application layer As such this vulnerability might not been seen as a vulnerability in TLS but the as the bad choice to merge two different requests together by the endpoint. Generic Example Openssl s_client –connect yourserver.com:443 GET / HTTP/1.0 Host:yourserver.com R (Triggers renegotiation – if this works, the server accepts renegotiations within an existing TLS session Req. #1) CRLF <server responds with content> (server merged both sessions Req. #2) Patched server with disabled renegotiation Openssl s_client –connect yourserver.com:443 R (Triggers renegotiation) 2860:error:1409444C:SSL routines:SSL3_READ_BYTES:tlsv1 alert no renegotiation:./ ssl/s3_pkt.c:1053:SSL alert number 100 20 http://www.openssl.org/ 24
  • 25. TLS & SSLv3 renegotiation vulnerability 2011 14. Conclusions The vulnerability lies within the core of TLS and SSLv3, and will rear its ugly head for years to come; the custom applications that are potentially vulnerable are innumerable. Servers  Servers that do allow mid-connection renegotiations are vulnerable  Applications that handle 2 TLS sessions as coming from the same client are vulnerable Clients  Clients have no means (pre TLS extension) to check if a renegotiation is happening and are vulnerable Sources 1. http://www.securityfocus.com/bid/36935 2. https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt 3. https://bugzilla.mozilla.org/show_bug.cgi?id=526689 4. http://blog.ivanristic.com/2009/11/ssl-and-tls-authentication-gap-vulnerability-discovered.html 5. http://www.leviathansecurity.com/pdf/ssltlstest.zip 6. http://extendedsubset.com/renegotiating_tls_20091104_pub.zip 7. https://bugzilla.redhat.com/show_bug.cgi?id=533125 8. http://www.mail-archive.com/users@tomcat.apache.org/msg69335.html 9. http://www.apache.org/dist/httpd/patches/apply_to_2.2.14/CVE-2009-3555-2.2.patch 10. http://sid.rstack.org/blog/index.php/373-tls-tout-le-monde-en-parle-pourquoi-pas-moi 11. https://www.mikestoolbox.net/ 12. http://extendedsubset.com/ 13. http://extendedsubset.com/Renegotiating_TLS.pdf 14. http://extendedsubset.com/Renegotiating_TLS_pd.pdf 15. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3555 16. http://www.chappellseminars.com/files/nutter-stevedispensa-sslgap.mp3 17. http://www.phonefactor.com/sslgap/ssl-tls-authentication-patches Thanks We would like to thank Marsh Ray, Alun Jones, Wietse Venema, Alexandre Dulaunoy, Noam Rathaus, j.clausing and Simon Zuckerbraun. 15. Disclaimer Information is believed to be accurate by the time of writing. As this vulnerability is complex this document may be prone to revisions in the future. 25