taskWeeChat - Tasks: task #12293, [enhancement] pin TLS certificates...

 
 

task #12293: [enhancement] pin TLS certificates using TOFU model

Submitted by:  Abel Luck <abelxluck>
Submitted on:  Fri 19 Oct 2012 01:20:49 PM UTC  
Votes:  4  
 
Category: NoneShould Start On: -
Should be Finished on: -Priority: 5 - Normal
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Originator Name: Open/Closed: Open
Planned Release: NoneIRC nick: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 07 Jan 2013 05:30:28 PM UTC, comment #2:

This is very useful not because of untrustworthy CAs, but because IRC networks (aside from Freenode) almost never use CA-issued certificates in the first place.

Mantas M. <grawity>
Fri 19 Oct 2012 01:20:49 PM UTC, comment #1:

This item has been reassigned from the project WeeChat bugs tracker to your tracker.

The original report is still available at bugs #37602

Following are the information included in the original report:

[field #0] Item ID: 37602
[field #1] Group ID: 4783
[field #2] Open/Closed: Open
[field #3] Severity: 3 - Normal
[field #4] Privacy: Public
[field #8] : Unknown bugs Field Display Type
[field #9] Category: irc plugin
[field #10] Submitted by: abelxluck
[field #11] Assigned to: None
[field #12] Submitted on: Fri 19 Oct 2012 03:05:08 PM CEST
[field #13] Summary: [enhancement] pin TLS certificates using TOFU model
[field #14] Original Submission: == Motivation ==

In these days where we can no longer trust Certificate Authorities (CAs) yet can't quite ditch th CA model entirely, we need to take additional precautions to ensure the integrity of our TLS sessions.

Currently weechat supports verifying a certificate and all the certs in the chain up to the CA. If any CA is compromised, then the game is up and we could be silently MITMed.

If we pin (i.e., store) a certificate after we see it and expect to see it again in the future, we effectively reduce the scope of authorities who can authenticate to us during the lifetime of the pin.

== Proposal ==

I propose augmenting this system with an optional additional verification step that pins the certificate on first use, and every connection thereafter expects the same certificate.

This is often called TOFU, for Trust On First Use . If you've ever used SSH you've used TOFU before. The familiar prompt when you connect to a server for the first time is TOFU+cert pinning in action.

This behavior will be optional and disabled by default. The reasoning for it being off by default is that irc servers often use pools of servers which could use different SSL certificates.

For example, if you connect to chat.freenode.net you could be directed to any number of servers, each with their own certificate.

Pinning is particularly useful in these circumstances:

  • self-signed certificates
  • single IRC servers (non-pooled)

== Implementation ==

Add the irc plugin option irc.server.ssl_pin as a boolean option.

If this option is enabled:

  • On first connection to a server, after performing the current CA chain verification, weechat will optionally store the cert in a local cache.
  • On subsequent connections, weechat will expect the same certificate to be in use (unless it has been expired or revoked) and will prompt the user if this is not the case.

=== Discussion ===

Thankfully, this is quite simple to implement using gnutls-3.0.13. It requires the use of just two gnutls functions. The documentation explains this in more detail.

You can view the sample client and compare it to irc_server_gnutls_callback() in irc-server.c

Of course this requires gnutls-3.0.13, which was released in Feburary 2012. This fact alone means we cannot push this feature until most distros have upgraded. That said, that gives us more time to implement and test it as a devel version.

Please discuss this proposal, I am more than willing to submit patches, but only if this is agreeable.

[field #16] Item Group: security
[field #17] Status: None
[field #18] Component Version: None
[field #19] Operating System: None
[field #20] Reproducibility: None
[field #21] Size (loc): None
[field #22] Fixed Release: None
[field #23] Planned Release: None
[field #24] Effort: 0.00
[field #28] Priority: 5 - Normal
[field #31] Percent Complete: 0%
[field #33] Release: 0.4.0-dev
[field #38] IRC nick: abeluck
[field #58] Custom Select Box #1: None
[field #59] Custom Select Box #2: None
[field #60] Custom Select Box #3: None
[field #61] Custom Select Box #4: None
[field #62] Custom Select Box #5: None
[field #63] Custom Select Box #6: None
[field #64] Custom Select Box #7: None
[field #65] Custom Select Box #8: None
[field #66] Custom Select Box #9: None
[field #67] Custom Select Box #10: None

Sebastien Helleu <flashcode>
Project Administrator
Fri 19 Oct 2012 01:20:49 PM UTC, original submission:

Motivation

In these days where we can no longer trust Certificate Authorities (CAs) yet can't quite ditch th CA model entirely, we need to take additional precautions to ensure the integrity of our TLS sessions.

Currently weechat supports verifying a certificate and all the certs in the chain up to the CA. If any CA is compromised, then the game is up and we could be silently MITMed.

If we pin (i.e., store) a certificate after we see it and expect to see it again in the future, we effectively reduce the scope of authorities who can authenticate to us during the lifetime of the pin.

Proposal

I propose augmenting this system with an optional additional verification step that pins the certificate on first use, and every connection thereafter expects the same certificate.

This is often called TOFU, for Trust On First Use . If you've ever used SSH you've used TOFU before. The familiar prompt when you connect to a server for the first time is TOFU+cert pinning in action.

This behavior will be optional and disabled by default. The reasoning for it being off by default is that irc servers often use pools of servers which could use different SSL certificates.

For example, if you connect to chat.freenode.net you could be directed to any number of servers, each with their own certificate.

Pinning is particularly useful in these circumstances:

  • self-signed certificates
  • single IRC servers (non-pooled)

Implementation

Add the irc plugin option irc.server.ssl_pin as a boolean option.

If this option is enabled:

  • On first connection to a server, after performing the current CA chain verification, weechat will optionally store the cert in a local cache.
  • On subsequent connections, weechat will expect the same certificate to be in use (unless it has been expired or revoked) and will prompt the user if this is not the case.
Discussion

Thankfully, this is quite simple to implement using gnutls-3.0.13. It requires the use of just two gnutls functions. The documentation explains this in more detail.

You can view the sample client and compare it to irc_server_gnutls_callback() in irc-server.c

Of course this requires gnutls-3.0.13, which was released in Feburary 2012. This fact alone means we cannot push this feature until most distros have upgraded. That said, that gives us more time to implement and test it as a devel version.

Please discuss this proposal, I am more than willing to submit patches, but only if this is agreeable.

Abel Luck <abelxluck>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tribut
  • -unavailable- added by grawity (Posted a comment)
  • -unavailable- added by grawity (Voted in favor of this item)
  • -unavailable- added by abelxluck (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 4 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 18 Jan 2014 06:50:21 PM UTCtributCarbon-Copy-=>Added tribut
    Mon 07 Jan 2013 05:28:25 PM UTCgrawityCarbon-Copy-=>Added grawity
    Fri 19 Oct 2012 01:20:49 PM UTCflashcodeReassign itemWeeChat, bug #37602=>WeeChat, task #12293

    Back to the top


    Powered by Savane 3.1-cleanup