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

From: [email-masked] (Martin Rex)
Date: Fri, 8 Mar 2019 02:46:40 +0100 (CET)

Just a quick comment, I haven't been following IETF work for months...

Sam Hartman <[email-masked]> wrote:
> 
> 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.

Frankly, the whole idea of channel bindings is thoroughly flawed,
and it _can_not_possibly_work_ whenever there are any application
level gateways ("proxies") involved in the communication path,
something that is pretty common in non-trivial application,
and in particular in non-trivial backend servers.

If you see someone using channel bindings, you can be pretty sure
that they're doing some kind of seriously stupid abuse of technology.

Whenever the *ENTIRE* application-level data is properly protected
with gss_wrap(conf=TRUE), channel bindings will provide *ZERO*
additional value, while creating a whole bunch of problems.

> 
> 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.

I agree, this is extremely disappointing.
In particular, because a general need is asserted, although just
the opposite is true, for honest and sane usage scenarios,
channel bindings are useless bloat that break application level
proxy traversal.

> 
> 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.

That is what the "ret_flags" could be used for.  There are still a few
free bits left in the 32-bit output value of the rfc2744 C-bindings.

> 
> 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.

Yes, apparently there are.

The application that I am aware of is Microsoft's proprietary
Hack rfc4559 HTTP Negotiate when used with Kerberos,
where TLS channel bindings are first asserted in Windows Vista (or Win7) ?

But rfc4559 is a crystal clear HACK, which misuses a naked rfc1964/rfc4121
two-token Kerberos authentication as an OTP scheme, and by NOT using
any of the GSS-API message protection facilities for the application data,
there is *NO* binding between the application data in the HTTP request
and the AP_REQ in the rfc4559 HTTP Request header, making that
approach vulnerable to man-in-the-middle attacks (proxying/relaying).

However, if the backend architecture uses a reverse proxy
(Load Balancer / "SSL-Accelerator"), while the HTTP-layer rfc4559 processing
is performed in the backend host (different machine), it is simply not
possible to perform channel binding to the TLS channel (that ended
on the reverse proxy).

>
> 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.

There is a serious security problem in rfc4559 HTTP negotiate.

Use of TLS channel bindings for rfc4559 is a mitigation to pretend
that the security problem doesn't exist.

> 
> 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.

-Martin

---

From: Greg Hudson <[email-masked]>
Date: Mon, 11 Mar 2019 00:25:57 -0400

1. Sam suggested that we consider allowing context establishment in the
acceptor-only binding case (i.e. where the acceptor caller provided
channel bindings but the initiator caller did not).  Sam notes that
Moonshot's GSS-EAP implementation allows this, and that policing a
legitimate initiator's decision to provide channel bindings isn't
security-critical in common scenarios.  He nevertheless supports a
mechanism to inform the acceptor whether channel bindings were used.

I discovered recently that Heimdal's krb5 mechanism permits
acceptor-only bindings, if I read the code correctly.  So it may be that
MIT's krb5 mech is unusual in rejecting the acceptor-only bindings case.
 (GNU Shishi's GSS krb5 mech does as well.)

Relaxing implementations to allow acceptor-only bindings solves the
original problem of allowing channel bindings to be introduced at
acceptors when not all initiators provide them.  But without some kind
of signalling, application code can't be certain in advance that it's
running against a relaxed implementation.  A mechanism attribute is the
most robust way to signal this.

2. Nico noted (out of band) that with a relaxed implementation, we can
communicate channel binding state very simply: allocate two ret_flags,
one for "channel bindings were used" and one for "channel bindings were
not used".  If you don't get either flag back, you're running against an
old implementation (or, on the initiator side, the mechanism protocol
doesn't provide confirmation).

In this model, we don't need a ret_flags_understood input to
accept_sec_context, and therefore don't need gss_create_sec_context().

3. Martin argues against channel bindings altogether, on the basis that
they break proxies and that it's better to use a channel security layer
tied to the authentication mechanism.  This viewpoint seems out of step
with the decision not to provide a security layer in SASL GS2.

Practically speaking, the most common underlying secure channel is TLS,
whose server authentication (when the client actually performs it)
prevents MITM attacks in most cases.  It is of some concern that TLS
does not have the same server naming or trust roots as the GSS
mechanism.  I'm not sure that amounts to a pressing need for channel
bindings, but I do see some value in them as a defense-in-depth measure
when it's not desirable to allow proxies.

I don't see much value in endpoint channel bindings.

Separately from all of this, I am a bit concerned that we are fulfilling
a need to upgrade from no-channel-bindings to channel-bindings, but once
an application protocol starts using channel bindings of any type, there
is no practical way to upgrade to a different type of channel bindings
without application-layer signalling.

---

From: Nico Williams <[email-masked]>
Date: Mon, 11 Mar 2019 13:57:07 -0500

On Mon, Feb 18, 2019 at 04:29:34PM -0500, Sam Hartman wrote:
> I've reviewed this document at the request of one of the authors, and
> here are my comments:

Thanks.

> not knowing if channel bindings are validated.

It's only flawed if you'd like to start using CB in applications that
lack a negotiation for it.  Modifying application protocols is
non-trivial.

> and unfortunately, this draft is filled with assertions of that fact

In GSS it is generally the case that all features are optional and one
finds out what one actually gets by looking at the ret_flags from
context establishment, but CB status is not indicated this way.  This
seems like at least an inconsistency.

Perhaps we can rephrase this?

> and would simplify application design.

Yes.

> 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.
> 

I believe IWA is such an application...

> 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.

There should be no backwards-incompatible changes.

I am open to re-designing this extension.

One alternative way to do what we're trying to do:

 - add TWO new, mutually-exclusive ret_flags and NO new req_flags

   GSS_C_CHANNEL_BOUND_FLAG
   GSS_C_CHANNEL_NOT_BOUND_FLAG

 - newer GSS implementations will set ONE of those ret_flags when the
   application provided channel bindings data

This is simpler as we then don't need to add a context creation
function.

Or we could add a GSS_Inquire_context_channel_binding() to indicate CB
status.

> * 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.

We might want to extend the Kebreros mechanism to provide signalling
about this from the acceptor to the initiator.

That could be done in a separate I-D.

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

In that case the acceptor could not signal CB status to the initiator,
not via a context token, though the application still could if it was
necessary.

> * 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.

As long as we provide a way to discover that CB failed, but continue
context establishment, we are making things better, not worse.

Presumably the operator of an MITM proxy would not want to permit
application-layer cryptographic session protection if the proxy cannot
MITM that.

(Most of the web is trending towards bearer tokens with no CB (and no
proof of possession, by definition), so your concern might not be
relevant to the web, but things could change, thus making your concern
relevant again.  :)

> * 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.

Sure.  As it happens the authors include maintainers or contributors to
two of the most common GSS C implementations.

I'll seek Luke's input.

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Mon, 11 Mar 2019 15:05:12 -0500

How about a much simpler proposal:

   If the application provided channel bindings, and channel binding
   succeeded, then the mechanism MUST include GSS_C_CHANNEL_BOUND_FLAG
   in the ret_flags.

   If the application did not provide channel bindings, but the peer
   did, then the mechanism may or may not fail security context
   establishment, but if it succeeds, it MUST NOT indicate the
   GSS_C_CHANNEL_BOUND_FLAG ret_flag to either peer.

   If both peer applications provided channel bindings and channel
   binding failed, then a mechanism MAY fail to establish a security
   context, but if it permits the context to establish, then it MUST NOT
   set GSS_C_CHANNEL_BOUND_FLAG in the ret_flags.

That would be the entirety of the normative text.

The "MAY" in the third paragraph involves an optional  backwards-
incompatible change, allowing implementations to choose whether to make
it, possibly based on local configuration, or on usage of the non-
standard gss_set_cred_option().

Nico
--

---

From: Greg Hudson <[email-masked]>
Date: Mon, 11 Mar 2019 16:59:09 -0400

>    succeeded, then the mechanism MUST include GSS_C_CHANNEL_BOUND_FLAG

MUST for accept_sec_context and MAY for init_sec_context, I assume.
(Since existing mech protocols don't provide CB confirmation, and CB
confirmation is typically impossible when mutual auth isn't used.)
>    set GSS_C_CHANNEL_BOUND_FLAG in the ret_flags.

My first concern is that this provides no meaningful promises to the
application about how accept_sec_context() will be affected by channel
bindings.  It might or might not cause failure on mismatched bindings
and it might or might not cause failure if the initiator provides no
bindings.  We could add mechanism attributes to distinguish, but that
unfortunately only helps if the acceptor is limited to one or a few
mechs (none of which is SPNEGO), since the choice to supply bindings
comes before we know the mechanism of the initiator token.

My second concern is that if an acceptor application does not see the
channel-bound ret_flag, it cannot distinguish between mismatched
bindings, a lack of bindings from the initiator, or an old
implementation.  (Knowledge of the mech implementation might rule out
some of those possibilities.)

If the goal is to allow applications, whose protocols can optionally use
gss_wrap(), to save some CPU cycles when channel bindings succeed, this
might be good enough--though in many cases admins would have to decide
whether to supply channel bindings based on knowledge they shouldn't
need to have.  I'm not sure if this is a worthwhile goal--do we know of
any specific applications which would benefit?

If the goal is to achieve defense-in-depth against MITM attacks when TLS
security fails, for protocols which never use gss_wrap() and at the cost
of disallowing proxies, then these semantics don't seem likely to
achieve the goal.

---

From: Sam Hartman <[email-masked]>
Date: Wed, 13 Mar 2019 16:04:31 -0400

>>>>> "Nico" == Nico Williams <[email-masked]> writes:

    >> 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.

    Nico> It's only flawed if you'd like to start using CB in
    Nico> applications that lack a negotiation for it.  Modifying
    Nico> application protocols is non-trivial.

How about.
"GSS-APi does not provide a mechanism to add channel bindings to
applications without adding a negotiation mechanism to determine when
channel bindings can be relied on.
This draft adds such a mechanism?
"

I'd avoid the word flaw in such a case, but don't care that much about
the text.  What I do care about is that I now understand what you're
trying to do, and I'm really happy about that.  I support the goal, with
some caviats I'll discuss below.

    >> 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.
    >> 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.

    Nico> I believe IWA is such an application...

I'm not familiar with that application.
Pointer?

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

    Nico> There should be no backwards-incompatible changes.

I listed one later in my review.
In particular, RFC 2743 permits a mechanism to entirely ignore CB.  This
draft requires that if an initiator passes in channel bindings without
the new flag, then CB fails.
I think that is not required by RFC 2743.  As such, this makes legal
mechanisms under 2743 into non-compliant mechanisms and thus is a
backward compatible change.

    Nico> I am open to re-designing this extension.

    >> * 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.

    Nico> We might want to extend the Kebreros mechanism to provide
    Nico> signalling about this from the acceptor to the initiator.

    Nico> That could be done in a separate I-D.

When I read the current draft it's not clear to me which sides get the
flag set and who knows CB has succeeded.  One advantage to adding
Kerberos signaling here or in a normative dependency is that we could
give both sides of the conversation info about whether CB has succeeded.

I think the current draft is too silent on whether the initiator learns
about CB success, the acceptor or both.  And unless we mandate
signaling, I think who learns about CB success depends a lot on the
mechanism involved.

I'd like to walk through what guarantees we can make, and then make sure
that is actually what applications need.

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

    Nico> In that case the acceptor could not signal CB status to the
    Nico> initiator, not via a context token, though the application
    Nico> still could if it was necessary.

First, you seem to be assuming that it's the acceptor that verifies CB.
Is that actually guaranteed by GSS?

Second, how does the acceptor application signal to the initiator about
CB?
The channel might not be verified, so the initiator cannot depend on
that.
There's no mutual authentication, so it's not like the initiator can
know that a wrap token is from the acceptor.
I actually think CB may be kind of useless without mutual auth.
My point is not that the draft is broken, simply that it doesn't cover
the case, and I think application designers are unlikely to be sure on
their own.

    >> * 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.

    Nico> As long as we provide a way to discover that CB failed, but
    Nico> continue context establishment, we are making things better,
    Nico> not worse.

To be concrete, I'm concerned that this makes channel binding better
 enough to work with proxies, but doesn't provide us channel
 binding type agility.

Addressing my concern might look like talking about proxies in the
security considerations section, noting that things like endpoint
channel bindings   are easier than unique when you have proxies.
And then noting that we have no plan for what happens when an
application without cb negotiation needs to change the preferred channel
binding type.
    >> * Please get review from multiple implementors before
    >> standardizing the create_context stuff.
    [This point has been addressed; Luke seemed fine when he wrote to
    the WG]