Subject: [kitten] Review of draft-ietf-kitten-channel-bound-flag-04

From: Sam Hartman <[email-masked]>
Date: Mon, 18 Feb 2019 16:29:34 -0500

I've reviewed this document at the request of one of the authors, and
here are my comments:

This draft is based on the premis that the GSS-API channel binding
behavior is flawed and that  there's a security problem associated with
not knowing if channel bindings are validated.

I've heard this argument over the years, but never been convinced of it,
and unfortunately, this draft is filled with assertions of that fact
without any rationale.

At one level it doesn't matter much.  I absolutely agree that a facility
for knowing if channel bindings are validated would be incredibly useful
and would simplify application design.

However, by jumping to the conclusion that we're fixing a flaw, I think
we approach interoperability and operational aspects with inadequate
thought.  I think we discard some of the options too early.

My past experience is that when we take short cuts like that, we find
ourselves frustrated later when we discover things we overlooked.

As I write this up, I'm realizing that the draft authors seem to be
making an assumption that  there are applications in the wild that pass
in channel bindings to the initiator but not the acceptor or vise
versa.  The only such application I'm aware of is gss ftp, which passed
IP address channel bindings into the acceptor and optionally initiator.
It would help me evaluate whether there is a security problem to
understand these applications better.
I note that SASL is not such an application.

Regardless of whether this is a security problem, I am very supportive
of a mechanism along these lines.  I think that it would simplify
application design over the approaches necessary for the gs2 family of
mechanisms.

I think the current draft has several shortcomings:

* I think that it inaccurately describes what RFC 2743 says and so it
does not call out backward incompatible changes.

* I think that it inaccurately describes what current implementations
  do.

* I think that more consideration needs to be given to situations where
one side supports the channel bound flag and the other does not and what
if any signaling changes are required.

* I think it does not consider behavior when mutual authentication is
not requested.

* I'm concerned that in thinking about channel binding we have not given
adequate thought to how channel binding interacts with proxies, reverse
proxies and the like.  I'm concerned that this draft makes that
situation worse, and so I'd recommend exploring that at least enough to
understand whether I'm right.

* Please get review from multiple implementors before standardizing the
create_context stuff.  In particular, do you want to take inputs like a
credential and/or a flag indicating the context is for initiation or
acceptor.  If yo,u've gotten review including from folks like Luke and
they are happy, then this is great.  It seems good for API users at
least.

Here are my specific comments:

>Note that it would be useless to allow security context
>   establishment to succeed when the initiator does not provide channel
>   bindings but the acceptor does, at least as long as there's no
>   outward indication of whether channel binding was used!

An exclamation in an IETF document is a good sign that you're letting
your emotions get ahead of your technical content and perhaps you should
take a step back.
I think the above quote is a good example.
You don't get MITM protection if the initiator provides channel binding
and the acceptor does, but it can be useful none-the-less.
Assuming that an attacker cannot convert a context token that has
channel bindings into one that does not, and initiators know acceptors
are providing channel bindings, then initiators know that if they
provide channel bindings then the channel bindings are validated.
That can provide you defense in depth, for example, binding channels to
a TLS channel binding in applications where you also validate the PKI
and have good trust anchors.
It cannot be sufficient alone to provide MITM defense.
However, additional layers of defense (provided they do not trigger
false negatives) are valuable in security.
Please rephrase to focus on the characteristics of the system rather
than judgments of those characteristics.

>   o  Whenever both the initiator and acceptor have provided
>      input_channel_bindings to GSS_Init/Accept_sec_context() and the
>      channel bindings do not match, then the mechanism MUST fail to
>      establish a security context token.  (This is a restatement of an
>      existing requirement in the base specification.)

Actually, as best I can tell, RFC 2743section 1.1.6 disagrees with
this.  It looks in RFC 2743 like channel bindings are optional for a
mechanism to use.
I think it's reasonable that if a mechanism supports channel bindings,
then if both the initiator and acceptor provide channel bindings they
must validate for context establishment to succeed.

>   o  Whenever the acceptor application has a) provided channel bindings
>      to GSS_Accept_sec_context(), and b) not indicated support for the
>      ret_channel_bound_flag flag, then the mechanism MUST fail to
>      establish a security context if the initiator did not provide
>      channel bindings data.  This requirement is critical for security
>      purposes, to make applications predating this document secure, and
>      this requirement reflects actual implementations as deployed.

Actually, this behavior is inconsistent with RFC 7055 section 5.6.2 and
with the Moonshot implementation of the ABFAB GSS-API mechanism.
In that mechanism, if the initiator provides null channel bindings, the
acceptor channel bindings are always ignored.
I'm not seeing the security issue here.  If you are using channel
bindings as a MITM defense rather than as an additional layer of
security, you need to do something like SASL does and have a plus and
minus varient of your protocol and always pass in channel bindings.

There's also what I think is a real operational issue here.  You may not
be able to know what your channel bindings are on an acceptor.
Depending on whether you are behind a TLS accelerator, reverse proxy or
the like, it may affect your ability to know your channel bindings.

I
>   o  Whenever the application has a) provided channel bindings to
>      GSS_Init_sec_context() or GSS_Accept_sec_context(), and b)
>      indicated support for the ret_channel_bound_flag flag, then the
>      mechanism SHOULD NOT fail to establish a security context just
>      because the peer did not provide channel bindings data.  The
>      mechanism MUST output the ret_channel_bound_flag if both peers
>      provided the same input_channel_bindings to GSS_Init_sec_context()
>      and GSS_Accept_sec_context().  The mechanism MUST NOT output the
>      ret_channel_bound_flag if either (or both) peer did not provide
>      input_channel_bindings to GSS_Init/Accept_sec_context().  This
>      requirement restores the original base GSS-API specified behavior,
>      with the addition of the ret_channel_bound_flag flag.

I think we need to consider the transition period here.
What happens when you have a new initiator talking to an old acceptor or
vice versa.Are you planning on introducing new over-the-wire signaling
so that an acceptor  can say something like "I'm setting up your
context, but your channel binding didn't verify?"
For example in RFC 7055, the channel binding data is sent as a checksum
from initiator to acceptor.  The acceptor either sends back a final
token or sends back an error depending on whether it accepts the
bindings.
How, without protocol changes would we meet this requirement.
Similarly, I think Kerberos works the same way in the mutual
authentication case.  In the non mutual authentication case, I don't
think the initiator even learns whether the acceptor validated the
channel bindings.

---

From: Sam Hartman <[email-masked]>
Date: Mon, 18 Feb 2019 16:39:12 -0500

>>>>> "Sam" == Sam Hartman <[email-masked]> writes:

nnel
    >> bindings to GSS_Accept_sec_context(), and b) not indicated
    >> support for the ret_channel_bound_flag flag, then the mechanism
    >> MUST fail to establish a security context if the initiator did
    >> not provide channel bindings data.  This requirement is critical
    >> for security purposes, to make applications predating this
    >> document secure, and this requirement reflects actual
    >> implementations as deployed.

    Sam> Actually, this behavior is inconsistent with RFC 7055 section
    Sam> 5.6.2 and with the Moonshot implementation of the ABFAB GSS-API
    Sam> mechanism.  In that mechanism, if the initiator provides null
    Sam> channel bindings, the acceptor channel bindings are always
    Sam> ignored.  I'm not seeing the security issue here.  If you are
    Sam> using channel bindings as a MITM defense rather than as an
    Sam> additional layer of security, you need to do something like
    Sam> SASL does and have a plus and minus varient of your protocol
    Sam> and always pass in channel bindings.

    Sam> There's also what I think is a real operational issue here.
    Sam> You may not be able to know what your channel bindings are on
    Sam> an acceptor.  Depending on whether you are behind a TLS
    Sam> accelerator, reverse proxy or the like, it may affect your
    Sam> ability to know your channel bindings.

I meant to go back and revise my review before sending.
I think it's something worth fixing that Kerberos and ABFAB have
inconsistent behavior here, and I do think it's worth standardizing.

I think  we're in a good position.  If we were to decide to relax the
behavior we'd be changing Kerberos in a manner where all authentications
that succeed today would continue to succeed.  Kerberos is much much
much more widely deployed than ABFAB.
If we were to decide to make the behavior as strict as described in this
draft, then we'd be potentially breaking valid uses of ABFAB, but I
think the ABFAB deployment is small enough that it is reasonable to do
that.

However, I think that the decision as to what to do should be based on
analysis of applications where one side uses channel bindings and the
other does not.  Since I'm not actually aware of any significant
applications that do that, I'll hold off until my previous question on
that issue is answered before forming my opinion on the correct
behavior.

---

From: Luke Howard <[email-masked]>
Date: Tue, 19 Feb 2019 13:29:03 +0100

> On 18 Feb 2019, at 10:29 pm, Sam Hartman <[email-masked]> wrote:
> 

gss_create_sec_context() and gss_set_context_flags() could be subsumed into gss_set_sec_context_option() which is supported by both Heimdal and MIT. But perhaps not as easy to use for the caller.

---

From: Greg Hudson <[email-masked]>
Date: Wed, 27 Feb 2019 12:25:36 -0500

> that issue is answered before forming my opinion on the correct

I think the practical motivation for this draft is a desire to add
channel bindings to application protocols which do not currently use
them.  I believe HTTP Negotiate is commonly given as a candidate.  So,
while I am not sure there are any applications in this category today,
there is a desire to (at least temporarily) create some in the future.

---

From: Sam Hartman <[email-masked]>
Date: Thu, 28 Feb 2019 11:03:30 -0500

>>>>> "Greg" == Greg Hudson <[email-masked]> writes:

    Greg> On 2/18/19 4:39 PM, Sam Hartman wrote:
    >> However, I think that the decision as to what to do should be
    >> based on analysis of applications where one side uses channel
    >> bindings and the other does not.  Since I'm not actually aware of
    >> any significant applications that do that, I'll hold off until my
    >> previous question on that issue is answered before forming my
    >> opinion on the correct behavior.

    Greg> I think the practical motivation for this draft is a desire to
    Greg> add channel bindings to application protocols which do not
    Greg> currently use them.  I believe HTTP Negotiate is commonly
    Greg> given as a candidate.  So, while I am not sure there are any
    Greg> applications in this category today, there is a desire to (at
    Greg> least temporarily) create some in the future.

HTTP negotiate seems like it will be an interesting design thought
exercise.

While working on Moonshot we spent some time trying to figure out how we
would approach channel binding for HTTP negotiate.

It seemed like deployment considerations made it kind of tricky.

Do I use unique or endpoint channel bindings?  That depends on several
factors:

* To use unique channel bindings I need to produce the GSS-API token on
  the client after the TLS connection is established.  That assumes a
  certain model for how the HTTP and TLS libraries interact.

* To use unique channel bindings on the server, I need access to  the
  appropriate hashes; that assumes my HTTP library and my TLS library
  make that available to whoever is producing the GSS token.  (In many
  but not all cases that will be part of the HTTP library)

OK, so just use endpoint channel bindings and be done with it.

Does the server actually know its endpoint channel binding?  If it's
behind a reverse proxy, that may depend a lot on the configuration.  TLS
may terminate at the reverse proxy.  The connection behind the reverse
proxy may be unencrypted, or it may be encrypted using a different
certificate.

We don't want to break things that work today.  Yes, channel bindings
would make that situation more secure, but HTTP negotiate has value
without channel bindings, demonstrated by the people who use it today.

Also, we've already found bugs in channel bindings (even for TLS).  So,
we probably want some sort of transition strategy.

So, it seems like you're almost always going to want some application
layer something to figure out whether channel bindings are supported on
both ends and whether to use them.  (And probably if they get used a
lot, which channel binding to use).
That's frustrating because it makes channel bindings not so simple.

Some thoughts:

The Moonshot behavior (null acceptor bindings ignores any initiator
  CB) makes it easier for people to withdraw from the channel binding
  process when  local configuration does not support channel binding.
If it weren't for there being multiple types of channel binding and a
  need to think about transitions, I'd argue that makes the Moonshot
  behavior clearly supperior especially if there are not currently
  applications that don't know whether they are doing CB.

Given that we probably should care about those issues, I'm not at all
sure I know what the right behavior should be for applications that do
not support this flag.

I'm still definitely in favor of the flag.  The more I look at this, I
don't think this is fixing a flaw in GSS-API, and I especially am not
seeing the security flaw.
I think it's adding a new capability with some tricky interoperability
and deployment considerations.