Hi Ben,


     For receiving, if the tls12_cid content type is set, then the CID is
     used to look up the connection and the security association.  If the
     tls12_cid content type is not set, then the connection and security
     association is looked up by the 5-tuple and a check MUST be made to
     determine whether the expected CID value is indeed zero length.  If
     the check fails, then the datagram MUST be dropped.

I guess there's maybe a risk that an attacker sets up a CID-ful
connection on a given 5-tuple and then disappears, thereby denying
the target of the attack the ability to use a CID-less DTLS association
on that 5-tuple.  But it would be hard to swamp all the ports, so it's
only likely to be an issue when fixed ports are used on both sides ...
which is known to happen sometimes.  Perhaps we should document this in
the security considerations.


I'm not sure, if I understand that well.
Do you assume, that in a network envirnoment, where the 5-tuple is not
stable, someone may use a CID and so block the (instable) 5-tuple? Yes,
but in that network your peer MUST anyway use new handshakes and so the
CID usage will be overwriten by the new handshake.
If the 5-tuples are stable, then the attack must spoof the 5-tuple, but
the hello verify mechanism will block that.

If I did't get it, it may be easier to discus this as issue in the
github repo.

I think you got it; I am just failing to remember where the "MUST anyway
use new handshakes" requirement comes in from.  And I guess that also
raises the question of what the expected behavior is when a server expects
CID-ful traffic on a given 5-tuple and receives an (unencrypted)
ClientHello on that 5-tuple.


"when a server expects CID-ful traffic on a given 5-tuple"

I'm not sure, why that should happen. If CID is used, the server should
not expect a given 5-tuple (at least not longer than a few seconds).
If a new CLIENT_HELLO arrives, it's first challenge it with a
HELLO_VERIFY_REQUEST. If that verification succeeds and a "old 5-tuple
of a previous CID message" is hit, then just mark/remove the 5-tuple of
that CID association. That mainly means, you will not be able to reach
the CID peer with that 5-tuple. That's anyway extremely common to lose
the ip-route to such CID peers, otherwise CID would not be required.

Just if you're interested:
I have already implemented that CID/5-tuple management in the open
source project Eclipse/Californium. (That project also contains a very
simple test-NAT, where you may simulate some address changes. But that
requires some more docu :-) ).
You may check, if that works as you would expect. Any feedback will be
very welcome. If you want ot use it with other implementations (e.g.
mbedTLS), ensure that the hello extension uses the right assigned IANA
value 53.


The TLS 1.2 notation is "seq_num" for the implicit sequence number, but
DTLS 1.2 says that the MAC input is the concatenation of the DTLS epoch
and the DTLS (explicit) sequence number.  I do not see this
concatenation given the name "seq_num" anywhere, so I think we need to
reformulate this expression.

             cid +
             cid_length +

Does this construction preserve injectivity?  It seems easier to reason
about when the length of an element is always before or always after the
element itself, but we put the length first for some of the other
fields (that appear after these) so there seems to be some malleability.

That order was also discussed a lot.
https://github.com/tlswg/dtls-conn-id/pull/29
I would prefer, if this is not changed again without strong arguments!

Thanks for the pointer!
I am not sure that the specific question about injectivity was raised
there, though.  (The topic of whether "seq_num" includes epoch was raised
but I did not see a clear resolution on my first reading, just
https://github.com/tlswg/dtls-conn-id/pull/29#discussion_r246152379)

Specifically, the question of "injectivity" is referring to a scenario
where I can use different actual values for (cid, cid_length,
length_of_DTLSInnerPlaintext, etc.) but have a collision in the constructed

cid + cid_length + length_of_DTLSInnerPlaintext + ...

(Hmm, we should probably say that length_of_DTLSInnerPlaintext is a 2-byte
field...)

Attempting to construct a trivial example on the fly, (hex)

01 01 02 02 01 <513 bytes of plaintext content>

could be cid_length=1, cid=0x01, length_of_DTLSInnerPlaintext=0x0202,
DTLSInnerPlaintext.content = 0x01 <513 bytes>, or it could be
cid_length=2, cis=0x0101, length_of_DTLSInnerPlaintext=0x0201,
DTLSInnerPlaintext.content = <513 bytes>.  The possibility of such a
collision weakens the cryptographic protection and should be avoided.


If that is going to be changed, the early adopters run into trouble with
their deployments!

The cid length is not on the wire, so on the wire is (cid 01 01)

> 01 01 02 01 <513 bytes of plaintext content>

Therefore I don't understand, WHO will inject something, which is not on
the wire. For me that would only be the peer's implementation, which
extracts it's "own" CID wrong, or a "spoofed CID" (maybe that's the time
to read my proposal about a CID Authentication Code, issue #74.). But
with the wrong CID, the wrong keys would be selected and the MAC will
fail anyway. So, I can't see that collision.

best regards
Achim

_______________________________________________
TLS mailing list
TLS@ietf.org
https://www.ietf.org/mailman/listinfo/tls

Reply via email to