Subject: [secdir] Secdir review of draft-ietf-dime-extended-naptr-06

From: Charlie Kaufman <[email-masked]>
Date: Tue, 3 May 2011 05:36:44 +0000

I have reviewed this document as part of the security directorate's ongoing effort to review all IETF documents being processed by the IESG.  These comments were written primarily for the benefit of the security area directors.  Document editors and WG chairs should treat these comments just like any other last call comments.

This document makes some straightforward extensions to the DNS records that support the Diameter protocol (RFC 3588). The goal is to improve performance over the previous approach where in some cases multiple servers would have to be contacted to determine which one(s) supported some particular application. As the document notes, there are no security issues beyond those that apply to the base protocol (RFC 3588).

So I found nothing objectionable in this document.

Unfortunately, the story doesn't end there. To understand this spec, I had to read the Diameter document. The approach that Diameter takes to configuration using DNS appears to leave a gaping security hole that should be examined by whoever is reviewing RFC 3588bis (which is also in final stages of approval). The problem is that TLS (or IPsec) is used to secure the Diameter connections themselves, and shared keys or certificates are used to authenticate the peer entities. But the DNS records appear to be used to learn the names of the peer entities which are subsequently authenticated. That means if someone could update DNS they could indicate the Diameter server for some domain was in fact some rogue server. So long as that rogue server could be authenticated, it would be trusted to speak for the domain in the context of Diameter.

I suspect common practice is to have Diameter server names be manually configured, in which case there is no vulnerability. But without looking at this in detail it would appear that the more flexible autoconfiguration via DNS is not secure. If so (I could easily be missing something), there are several ways it could be fixed. DNSSEC would be the obvious solution, but not necessarily the best. DNSSEC is still not widely deployed, and this protocol is unlikely to act as a forcing function. Better would be to put some sort of extension in the certificates of Diameter certificates that indicates the domain(s) over which the server has jurisdiction in this context. Yet another option would be some naming convention for finding the name of Diameter servers for a particular domain rather than looking them up in DNS.

In any case, someone should have a look.

                --Charlie

---

From: Glen Zorn <[email-masked]>
Date: Sun, 15 May 2011 14:28:29 +0700

On 5/3/2011 12:36 PM, Charlie Kaufman wrote:

...

> Unfortunately, the story doesn’t end there. To understand this spec, I
> had to read the Diameter document. The approach that Diameter takes to
> configuration using DNS appears to leave a gaping security hole that
> should be examined by whoever is reviewing RFC 3588bis (which is also in
> final stages of approval). The problem is that TLS (or IPsec) is used to
> secure the Diameter connections themselves, and shared keys or
> certificates are used to authenticate the peer entities. But the DNS
> records appear to be used to learn the names of the peer entities which
> are subsequently authenticated. That means if someone could update DNS
> they could indicate the Diameter server for some domain was in fact some
> rogue server. So long as that rogue server could be authenticated, it
> would be trusted to speak for the domain in the context of Diameter.

I don't think that that is actually true (see below).

> 
>  
> 
> I suspect common practice is to have Diameter server names be manually
> configured, in which case there is no vulnerability. But without looking
> at this in detail it would appear that the more flexible
> autoconfiguration via DNS is not secure. If so (I could easily be
> missing something), there are several ways it could be fixed. DNSSEC
> would be the obvious solution, but not necessarily the best. DNSSEC is
> still not widely deployed, and this protocol is unlikely to act as a
> forcing function. 
> Better would be to put some sort of extension in the
> certificates of Diameter certificates that indicates the domain(s) over
> which the server has jurisdiction in this context. 

>From draft-ietf-dime-rfc3588bis, Section 5.2:

   If the server is using a site certificate, the domain name in the
   NAPTR query and the domain name in the replacement field MUST both be
   valid based on the site certificate handed out by the server in the
   TLS/TCP and DTLS/SCTP or IKE exchange.  Similarly, the domain name in
   the SRV query and the domain name in the target in the SRV record
   MUST both be valid based on the same site certificate.  Otherwise, an
   attacker could modify the DNS records to contain replacement values
   in a different domain, and the client could not validate that this
   was the desired behavior, or the result of an attack.

   Also, the Diameter Peer MUST check to make sure that the discovered
   peers are authorized to act in its role.  Authentication via IKE or
   TLS/TCP and DTLS/SCTP, or validation of DNS RRs via DNSSEC is not
   sufficient to conclude this.  For example, a web server may have
   obtained a valid TLS/TCP and DTLS/SCTP certificate, and secured RRs
   may be included in the DNS, but this does not imply that it is
   authorized to act as a Diameter Server.

   Authorization can be achieved for example, by configuration of a
   Diameter Server CA.  Alternatively this can be achieved by definition
   of OIDs within TLS/TCP and DTLS/SCTP or IKE certificates so as to
   signify Diameter Server authorization.

This seems to address the issue, the only problem I can see is that the
last sentence of the second paragraph quoted above might not be specific
enough; maybe change "authorized to act as a Diameter Server." to
"authorized to act as a Diameter Server for the given realm."?

> Yet another option
> would be some naming convention for finding the name of Diameter servers
> for a particular domain rather than looking them up in DNS.

I think that that was discussed at some point thousands of years ago but
rejected; I don't recall why.

...