exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

WeeChat Invalid Certificate Check

WeeChat Invalid Certificate Check
Posted Feb 28, 2011
Authored by JD

WeeChat suffers from an invalid certificate verification vulnerability.

tags | advisory, bypass
SHA-256 | b244384a98f92322c920ae9a0922ecf9ded2df274ee6fe2b1625224736dcb748

WeeChat Invalid Certificate Check

Change Mirror Download
About WeeChat:
"WeeChat is a fast, light and extensible chat client. It runs on many
platforms (including Linux, BSD and Mac OS).
Development is very active, and bug fixes are very fast!"

The vuln:
Weechat does not use the GnuTLS API properly to check certificates,
potentially exposing users to man-in-the-middle attacks.

Weechat registers a callback function to be called by GnuTLS during
the TLS/SSL handshake. The function perform checks on the server
certificate and optionally, send a client certificate.
The mentioned code is located in src/core/wee-network.c in the
network_init function:

gnutls_certificate_client_set_retrieve_function (gnutls_xcred,

&hook_connect_gnutls_set_certificates);

Excerpt from gnutls's doc:

gnutls_certificate_client_set_retrieve_function sets a callback to
be called in order to retrieve the certificate to be used in the
handshake.
(...)
If the callback function is provided then gnutls will call it, in
the handshake, after the certificate request message has been
received.

This callback function will only be called when the server ask for a
client certificate during the handshake, but weechat also use this
callback
to check the server certificate.

As specified in the rfc2246 at 7.4.6., the certificate request is optionnal:

7.4.6. Client certificate

When this message will be sent:
This is the first message the client can send after receiving a
server hello done message. This message is only sent if the
server requests a certificate.

So when the server does not request a client certificate,
hook_connect_gnutls_set_certificates is never called and weechat does
not
perform any check on the server certificate. It doesn't print any of
the usual information about the dh key size and the content
of the server certificate either.

POC:

$ openssl genrsa -out server.key 4096
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
$ openssl dhparam -outform PEM -out dhparam.pem 4096
$ openssl s_server -cert server.crt -key server.key -dhparam
dhparam.pem -accept 6697 &>./log &
$ weechat-curses ircs://127.0.0.1:6697 # will not check the certificate
$ fg
^C
$ openssl s_server -cert server.crt -key server.key -dhparam
dhparam.pem -accept 6697 -verify yes &>./log2 &
$ weechat-curses ircs://127.0.0.1:6697 # will print an error because
the certificate is self signed

This problem affects all versions. The maintainer has been contacted
and a fix should be published. someday...
A "beta" fix is availaible here: http://savannah.nongnu.org/patch/index.php?7459

JD

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close