Antoine Beaupr : CVE-2020-13777 GnuTLS audit: be scared
PSA: don't rely on GnuTLS, please. CVE-2020-13777 Whoops, for the past 10 releases most TLS 1.0 1.2 connection could be passively decrypted and most TLS 1.3 connections intercepted. Trivially. Also, TLS 1.2 1.0 session tickets are awful.You are reading this correctly: supposedly encrypted TLS connections made with affected GnuTLS releases are vulnerable to passive cleartext recovery attack (and active for 1.3, but who uses that anyways). That is extremely bad. It's pretty close to just switching everyone to HTTP instead of HTTPS, more or less. I would have a lot more to say about the security of GnuTLS in particular -- and security in general -- but I am mostly concerned about patching holes in the roof right now, so this article is not about that. This article is about figuring out what, exactly, was exposed in our infrastructure because of this.
Affected packages
Assuming you're running Debian, this will show a list of packages that
Depends on GnuTLS:
apt-cache --installed rdepends libgnutls30 grep '^ ' sort -u
This assumes you run this only on hosts running Buster or
above. Otherwise you'll need to figure out a way to pick machines
running GnuTLS 3.6.4 or later.
Note that this list only first level dependencies! It is perfectly
possible that another package uses GnuTLS without being listed
here. For example, in the above list I have libcurl3-gnutls, so the
be really thorough, I would actually need to recurse down the
dependency tree.
On my desktop, this shows an "interesting" list of targets:
apt
cadaver - AKA WebDAV
curl & wget
fwupd - another attack on top of this one
git (through the libcurl3-gnutls dependency)
mutt - all your emails
weechat - your precious private chats
Arguably, fetchers like apt, curl, fwupd, and wget rely on HTTPS for
"authentication" more than secrecy, although apt has its own
OpenPGP-based authentication so that wouldn't matter anyways. Still,
this is truly distressing. And I haven't mentioned here things like
gobby, network-manager, systemd, and others - the scope of this is
broad. Hell, even good old lynx links against GnuTLS.
In our infrastructure, the magic command looks something like this:
cumin -o txt -p 0 'F:lsbdistcodename=buster' "apt-cache --installed rdepends libgnutls30 grep '^ ' sort -u" tee gnutls-rdepds-per-host awk ' print $NF ' sort uniq -c sort -n
There, the result is even more worrisome, as those important packages seem to rely on GnuTLS for their transport security:
mariadb - all MySQL traffic and passwords
mandos - full disk encryption
slapd - LDAP passwords
mandos is especially distressing although it's probably not
vulnerable because it seems it doesn't store the cleartext -- it's
encrypted with the client's OpenPGP public key -- so the TLS tunnel
never sees the cleartext either.
Other reports have also mentioned the following servers link
against GnuTLS and could be vulnerable:
exim
rsyslog
samba
- various
VNC implementations
Not affected
Those programs are not affected by this vulnerability:
apache2
gnupg
python
nginx
openssh
This list is not exhaustive, naturally, but serves as an example of
common software you don't need to worry about.
The vulnerability only exists in GnuTLS, as far as we know, so
programs linking against other libraries are not vulnerable.
Because the vulnerability affects session tickets -- and those are set
on the server side of the TLS connection -- only users of GnuTLS as a
server are vulnerable. This means, for example, that while weechat
uses GnuTLS, it will only suffer from the problem when acting as a
server (which it does, in relay mode) or, of course, if the remote IRC
server also uses GnuTLS. Same with apt, curl, wget, or git: it is
unlikely to be a problem because it is only used as a client; the
remote server is usually a webserver -- not git itself -- when using
TLS.
Caveats
Keep in mind that it's not because a package links against GnuTLS that
it uses it. For example, I have been told that, on Arch Linux, if
both GnuTLS and OpenSSL are available, the mutt package will use the
latter, so it's not affected. I haven't confirmed that myself nor have I
checked on Debian.
Also, because it relies on session tickets, there's a time window
after which the ticket gets cycled and properly initialized. But that
is apparently 6 hours by default so it is going to protect only
really long-lasting TLS sessions, which are uncommon, I would argue.
My audit is limited. For example, it might have been better to walk
the shared library dependencies directly, instead of relying on Debian
package dependencies.
Other technical details
It seems the vulnerability might have been introduced in this merge
request, itself following a (entirely reasonable) feature request
to make it easier to rotate session tickets. The merge request was
open for a few months and was thoroughly reviewed by a peer before
being merged. Interestingly, the vulnerable function
(_gnutls_initialize_session_ticket_key_rotation), explicitly says:
* This function will not enable session ticket keys on the server side. That is done
* with the gnutls_session_ticket_enable_server() function. This function just initializes
* the internal state to support periodical rotation of the session ticket encryption key.
In other words, it thinks it is not responsible for session ticket
initialization, yet it is. Indeed, the merge request fixing the
problem unconditionally does this:
memcpy(session->key.initial_stek, key->data, key->size);
I haven't reviewed the code and the vulnerability in detail, so take
the above with a grain of salt.
The full patch is available here. See also the upstream issue
1011, the upstream advisory, the Debian security
tracker,
and the Redhat Bugzilla.
Moving forward
The impact of this vulnerability depends on the affected packages and
how they are used. It can range from "meh, someone knows I downloaded
that Debian package yesterday" to "holy crap my full disk encryption
passwords are compromised, I need to re-encrypt all my drives",
including "I need to change all LDAP and MySQL passwords".
It promises to be a fun week for some people at least.
Looking ahead, however, one has to wonder whether we should follow
@FiloSottile's advice and stop using GnuTLS altogether. There are
at least a few programs that link against GnuTLS because of the
OpenSSL licensing oddities but that has been first announced in
2015, then definitely and clearly resolved in 2017 -- or maybe
that was in 2018? Anyways it's fixed, pinky-promise-I-swear,
except if you're one of those weirdos still using GPL-2, of
course. Even though OpenSSL isn't the simplest and secure TLS
implementation out there, it could preferable to GnuTLS and maybe we
should consider changing Debian packages to use it in the future.
But then again, the last time something like this happened, it was
Heartbleed and GnuTLS wasn't affected, so who knows... It is
likely that people don't have OpenSSL in mind when they suggest moving
away from GnuTLS and instead think of other TLS libraries like
mbedtls (previously known as PolarSSL), NSS, BoringSSL,
LibreSSL and so on. Not that those are totally sinless either...
"This is fine", as they say...
apt-cache --installed rdepends libgnutls30 grep '^ ' sort -u
aptcadaver - AKA WebDAVcurl & wgetfwupd - another attack on top of this onegit (through the libcurl3-gnutls dependency)mutt - all your emailsweechat - your precious private chatscumin -o txt -p 0 'F:lsbdistcodename=buster' "apt-cache --installed rdepends libgnutls30 grep '^ ' sort -u" tee gnutls-rdepds-per-host awk ' print $NF ' sort uniq -c sort -n
mariadb - all MySQL traffic and passwordsmandos - full disk encryptionslapd - LDAP passwordseximrsyslogsambaVNC implementationsapache2gnupgpythonnginxopenssh
weechat
uses GnuTLS, it will only suffer from the problem when acting as a
server (which it does, in relay mode) or, of course, if the remote IRC
server also uses GnuTLS. Same with apt, curl, wget, or git: it is
unlikely to be a problem because it is only used as a client; the
remote server is usually a webserver -- not git itself -- when using
TLS.
Caveats
Keep in mind that it's not because a package links against GnuTLS that
it uses it. For example, I have been told that, on Arch Linux, if
both GnuTLS and OpenSSL are available, the mutt package will use the
latter, so it's not affected. I haven't confirmed that myself nor have I
checked on Debian.
Also, because it relies on session tickets, there's a time window
after which the ticket gets cycled and properly initialized. But that
is apparently 6 hours by default so it is going to protect only
really long-lasting TLS sessions, which are uncommon, I would argue.
My audit is limited. For example, it might have been better to walk
the shared library dependencies directly, instead of relying on Debian
package dependencies.
Other technical details
It seems the vulnerability might have been introduced in this merge
request, itself following a (entirely reasonable) feature request
to make it easier to rotate session tickets. The merge request was
open for a few months and was thoroughly reviewed by a peer before
being merged. Interestingly, the vulnerable function
(_gnutls_initialize_session_ticket_key_rotation), explicitly says:
* This function will not enable session ticket keys on the server side. That is done
* with the gnutls_session_ticket_enable_server() function. This function just initializes
* the internal state to support periodical rotation of the session ticket encryption key.
In other words, it thinks it is not responsible for session ticket
initialization, yet it is. Indeed, the merge request fixing the
problem unconditionally does this:
memcpy(session->key.initial_stek, key->data, key->size);
I haven't reviewed the code and the vulnerability in detail, so take
the above with a grain of salt.
The full patch is available here. See also the upstream issue
1011, the upstream advisory, the Debian security
tracker,
and the Redhat Bugzilla.
Moving forward
The impact of this vulnerability depends on the affected packages and
how they are used. It can range from "meh, someone knows I downloaded
that Debian package yesterday" to "holy crap my full disk encryption
passwords are compromised, I need to re-encrypt all my drives",
including "I need to change all LDAP and MySQL passwords".
It promises to be a fun week for some people at least.
Looking ahead, however, one has to wonder whether we should follow
@FiloSottile's advice and stop using GnuTLS altogether. There are
at least a few programs that link against GnuTLS because of the
OpenSSL licensing oddities but that has been first announced in
2015, then definitely and clearly resolved in 2017 -- or maybe
that was in 2018? Anyways it's fixed, pinky-promise-I-swear,
except if you're one of those weirdos still using GPL-2, of
course. Even though OpenSSL isn't the simplest and secure TLS
implementation out there, it could preferable to GnuTLS and maybe we
should consider changing Debian packages to use it in the future.
But then again, the last time something like this happened, it was
Heartbleed and GnuTLS wasn't affected, so who knows... It is
likely that people don't have OpenSSL in mind when they suggest moving
away from GnuTLS and instead think of other TLS libraries like
mbedtls (previously known as PolarSSL), NSS, BoringSSL,
LibreSSL and so on. Not that those are totally sinless either...
"This is fine", as they say...
_gnutls_initialize_session_ticket_key_rotation), explicitly says:
* This function will not enable session ticket keys on the server side. That is done
* with the gnutls_session_ticket_enable_server() function. This function just initializes
* the internal state to support periodical rotation of the session ticket encryption key.
In other words, it thinks it is not responsible for session ticket
initialization, yet it is. Indeed, the merge request fixing the
problem unconditionally does this:
memcpy(session->key.initial_stek, key->data, key->size);
I haven't reviewed the code and the vulnerability in detail, so take
the above with a grain of salt.
The full patch is available here. See also the upstream issue
1011, the upstream advisory, the Debian security
tracker,
and the Redhat Bugzilla.
I've been digging into async exceptions in haskell, and getting more
and more concerned. In particular, 
Well, I'm sure many of you know "normal" XMPP clients such as Gajim or Dino on Linux, Conversations on Android or Siskin/Monal/ChatSecure on Apple IOS. There are plenty of other clients of course and maybe you used an XMPP client in the past without knowing it. For example Jitsi Meet is based on XMPP and you can still download the Jitsi Desktop client and use it as a full-featured multi-protocol client, e.g. for XMPP and SIP. In fact Jitsi Desktop is maybe the client that comes closest to Cisco Jabber as a chat/voice/video client. In fact I already connected Jitsi Desktop to Cisco CUCM/IM&P infrastructure, but of course you won't be able to use all those Cisco proprietary extensions, but you can see the benefit of open, standardized protocols such as XMPP and SIP: you are free to use any standard compliant client that you want.
So, while Jitsi supported voice/video calls for a long time, even before they focussed on Jitsi Meet as a WebRTC based conference service, Conversations added this feature last month, as already stated. This had a huge effect to the whole XMPP federation, because you need an XMPP server that supports XEP-0215 to make these audio/video calls work. The well-known 







I have been quite absent from Debian stuff lately, but this increased since COVID-19 hits us. In this blog post I'll try to sketch what I have been doing to help fight COVID-19 this last few months.







Previously: 
I found a
Like
Because
I have been using my Geforce 1060 extensively for deep learning, both with
Preliminaries
So what is the starting point: I am running Debian/unstable with a AMD Radeon 5700. First of all I purged all NVIDIA related packages, and that are a lot I have to say. Be sure to search for nv and nvidia and get rid of all packages. For safety I did reboot and checked again that no kernel modules related to NVIDIA are loaded.
Firmware
Debian ships the package
(Note that in this diagram 60 is, in fact, wrong,
and this picture swaps the hundreds and the thousands.)
We ll start with the units.
The last three fingers of the left hand, middle, ring, and pinkie,
are used to form them.
Zero is formed with an open hand, the opposite of the finger
counting we re used to.
One is formed by bending the middle joint of the pinkie,
two by including the ring finger and three by including the
middle finger, all at the middle joint.
You ll want to keep all these bends fairly loose, as otherwise
these numbers can get quite uncomfortable.
For four, you extend your pinkie again, for five, also raise your
ring finger, and for six, you raise your middle finger as well, but
then lower your ring finger.
For seven you bend your pinkie at the bottom joint, for eight
adding your ring finger, and for nine, including your middle
finger. This mirrors what you did for one, two and three, but
bending the finger at the bottom joint now instead.
This leaves your thumb and index finger for the tens.
For ten, touch the nail of your index finger to the inside of your top thumb
joint.
For twenty, put your thumb between your index and middle fingers.
For thirty, touch the nails of your thumb and index fingers.
For forty, bend your index finger slightly towards your palm
and place your thumb between the middle and top knuckle of your
index finger.
For fifty, place your thumb against your palm.
For sixty, leave your thumb where it is and wrap your index
finger around it (the diagram above is wrong).
For seventy, move your thumb so that the nail touches between the
middle and top knuckle of your index finger.
For eighty, flip your thumb so that the bottom of it now
touches the spot between the middle and top knuckle of your index
finger.
For ninety, touch the nail of your index finger to your bottom
thumb joint.
The hundreds and thousands use the same positions on the right
hand, with the units being the thousands and the tens being the
hundreds. One account, from which the picture above comes, swaps
these two, but the first account we have uses this ordering.
Combining all these symbols, you can count all the way to 9,999
yourself on just two hands. Try it!









