Subject: [MBONED] draft-eitf-mboned-auto-multicast: Defending against DoS via Teardown

From: Greg Bumgardner <[email-masked]>
Date: Thu, 04 Aug 2011 14:43:53 -0700

All,

The protocol described in the latest draft does not provide any defense 
against a denial-of-service attack on a gateway in which an eavesdropper 
forges a Teardown message to terminate a session and thereby interrupt 
any active multicast streams.

I believe we can make it much more difficult for another entity to send 
a valid teardown message by changing how a request nonce is generated 
and used in the Request, Membership Update and Teardown messages.

The solution involves sending a hashed value as the request nonce in the 
request and update messages, but sending the un-hashed value in the 
Teardown message. If both the relay and gateway use the same hash 
function, the relay can obtain the hashed nonce value used in MAC 
generation by applying the hash function to the nonce value sent in the 
Teardown message. If a cryptographic hash is used (e.g. MD5), an 
eavesdropper will not (easily) be able to guess what nonce value must be 
sent in the Teardown message to produce a valid MAC value.

What follows is some simplistic pseudo-code that describes the procedure:

H(): Hash function used by relay to generate MAC values
HKr = Secret hash key used by relay to generate MAC values
MD5(): MD5 Hash function
N: nonce (random value)

---- Gateway ----
GatewayInterface gif;
gif.last_address = null
gif.last_port = null
gif.last_mac = null
gif.last_nonce = null;
gif.nonce = rand();
gif.hashed_nonce = MD5(nonce);
Request request;
request.hashed_nonce = gif.hashed_nonce;
send(request);

---- Relay ----
Message message = receive();
if (message.type == REQUEST) {
     Request request = (Request)message;
     Query query;
     query.nonce = request.nonce;
     query.mac = H(HKr, request.src_addr, request.src_port, 
request.hashed_nonce);
     query.gateway_addr = request.src_addr;
     query.gateway_port = request.src_port;
     send(query);
}

---- Gateway ----
Query query = receive();
if (last_addr != null && (query.gateway_addr != last_addr || 
query.gateway_port != last_port)) {
     // Send Teardown
     Teardown teardown;
     teardown.mac = gif.last_mac;
     teardown.nonce = gif.last_nonce; // Not hashed!
     teardown.orig_addr = gif.last_addr;
     teardown.orig_port = gif.last_port;
     send(teardown);
}
gif.last_nonce = nonce;
gif.last_mac = query.mac;
gif.last_addr = query.gateway_addr;
gif.last_port = query.gateway_port;
Update update;
update.hashed_nonce = gif.hashed_nonce;
update.mac = query.mac;
update.report = <igmp/mld report>
send(update);

---- Relay ----
Message message = receive();
if (message.type == UPDATE) {
     Update update = (Update)message;
     if (update.mac == H(HKr, update.src_addr, update.src_port, 
update.hashed_nonce)) {
         if (!session_exists(update.src_addr, update.src_port)) {
             create_session(update.src_addr, update.src_port);
         }
         update_session(update.src_addr, update.src_port, update.report);
     }
     else {
         // MAC validation failed - ignore message
     }
}
else if (message.type == TEARDOWN) {
     Teardown teardown = (Teardown)message;
     if (teardown.mac == H(HKr, teardown.orig_addr, teardown.orig_port, 
MD5(teardown.nonce))) {
         if (session_exists(teardown.orig_addr, teardown.src_port)) {
             destroy_session(update.src_address, update.src_port);
         }
     }
     else {
         // MAC validation failed - ignore message
     }
}

======================

Thanks,

-g.b.

Greg Bumgardner
Cisco Systems

---

From: Greg Bumgardner <[email-masked]>
Date: Thu, 04 Aug 2011 14:58:25 -0700

Minor fix below...

On 8/4/2011 2:43 PM, Greg Bumgardner wrote:
>
>  All,
>
> The protocol described in the latest draft does not provide any 
> defense against a denial-of-service attack on a gateway in which an 
> eavesdropper forges a Teardown message to terminate a session and 
> thereby interrupt any active multicast streams.
>
> I believe we can make it much more difficult for another entity to 
> send a valid teardown message by changing how a request nonce is 
> generated and used in the Request, Membership Update and Teardown 
> messages.
>
> The solution involves sending a hashed value as the request nonce in 
> the request and update messages, but sending the un-hashed value in 
> the Teardown message. If both the relay and gateway use the same hash 
> generation by applying the hash function to the nonce value sent in 
> the Teardown message. If a cryptographic hash is used (e.g. MD5), an 
> eavesdropper will not (easily) be able to guess what nonce value must 
> be sent in the Teardown message to produce a valid MAC value.
>
This
>     query.nonce = request.nonce;
Should be:

query.hashed_nonce = request.hashed_nonce;
> _______________________________________________
> MBONED mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/mboned
>