[LAC-TF] ICMPv6-based DoS (filtrado de ICMPv6 PTB o IPv6 frags en peers BGP)

Fernando Gont fgont at si6networks.com
Thu Jan 12 10:11:29 BRST 2017


Estimados,

La historia es simple: enviando un paquete ICMPv6 "Packet Too Big" (PTB)
que anuncie un MTU<1280 bytes, se puede "disparar" el uso de
fragmentacion por parte del sistema que lo recibe.

En este sentido, hay dos situaciones:

* BGP: En ocasiones, el administrador de un router BGP filtra los
fragmentos IPv6 destinados al router, para mitigar ataques de
fragmentacion. Sin embargo, si el otro BGP peer no filtra los mensajes
de error ICMPv6 PTB destinados a si mismo, entonces hay un vector de
DoS. (el atacante envia un mensaje ICMPv6 PTB a un router para que el
mismo empiece a enviar el trafico fragmentado, y  el otro router termina
descartando dicho trafico, produciendose un DoS).

* Servidores en general: Dado que en muchos puntos de Internet se
filtran los paquetes que utilizan Encabezados de Extension (EHs), se
puede realizar un DoS a una conexion arbitraria enviando un mensaje
ICMPv6 PTB al servidor, para que produzca trafico fragmentado, que
subsecuentemente será descartado por la red.


Cuestiones a considerar:

* BGP:
 Filtran Uds. el trafico fragmentado enviado al router BGP?

  Filtran Uds. los mensajes ICMPv6 PTB entrantes al router BGP? (al
  menos los que anuncian un MTU<1280).

   Si filtraran algunos de los dos paquetes anteriores: se intento, en
   algun momento, coordinar una politica de filtrado con el otro u otros
   peers?  (por ejemplo, para que ambos filtren tanto los fragmentos
   como los errores ICMPv6 PTB).

* Servidores:
   Filtran Uds. los mensajes ICMPv6 PTB entrantes que anuncian un
   MTU<1280 bytes?

   De no hacerlo, podría ser trivial hacer DoS entre dos servidores
   "conocidos".


Esto esta descripto en la Seccion 2 del (recientemente publicado) RFC8021:
---- cut here ----
   The security implications of IP fragmentation have been discussed at
   length in [RFC6274] and [RFC7739].  An attacker can leverage the
   generation of IPv6 atomic fragments to trigger the use of
   fragmentation in an arbitrary IPv6 flow (in scenarios in which actual
   fragmentation of packets is not needed) and can subsequently perform
   any type of fragmentation-based attack against legacy IPv6 nodes that
   do not implement [RFC6946].  That is, employing fragmentation where
   not actually needed allows for fragmentation-based attack vectors to
   be employed, unnecessarily.

   We note that, unfortunately, even nodes that already implement
   [RFC6946] can be subject to DoS attacks as a result of the generation
   of IPv6 atomic fragments.  Let us assume that Host A is communicating
   with Host B and that, as a result of the widespread dropping of IPv6
   packets that contain extension headers (including fragmentation)
   [RFC7872], some intermediate node filters fragments between Host B
   and Host A.  If an attacker sends a forged ICMPv6 PTB error message
   to Host B, reporting an MTU smaller than 1280, this will trigger the
   generation of IPv6 atomic fragments from that moment on (as required
   by [RFC2460]).  When Host B starts sending IPv6 atomic fragments (in
   response to the received ICMPv6 PTB error message), these packets
   will be dropped, since we previously noted that IPv6 packets with
   extension headers were being dropped between Host B and Host A.
   Thus, this situation will result in a DoS scenario.

   Another possible scenario is that in which two BGP peers are
   employing IPv6 transport and they implement Access Control Lists
   (ACLs) to drop IPv6 fragments (to avoid control-plane attacks).  If
   the aforementioned BGP peers drop IPv6 fragments but still honor
   received ICMPv6 PTB error messages, an attacker could easily attack
   the corresponding peering session by simply sending an ICMPv6 PTB
   message with a reported MTU smaller than 1280 bytes.  Once the attack
   packet has been sent, the aforementioned routers will themselves be
   the ones dropping their own traffic.
---- cut here ----


Para el que desee hacer pruebas, utilizar la herramienta icmp6 de
<https://www.si6networks.com/tools/ipv6toolkit>, así:

Por ej., en el caso de querer reproducir un DoS entre un cliente web y
un servidor web, uno lo haria asi:


1) Probar conectividad con el servider, tipo:
telnet SERVER_IPV6 80

(aca podrian establecer la conexion sin problemas)

2) hacer el ataque
# icmp6  --icmp6-packet-too-big -d SERVER_IPV6 --peer-addr CLIENT_IPV6
--mtu 1000 -o 80 -v

Donde:
  SERVER_IPV6: Direccion IPv6 del servidor
  CLIENT_IPV6: Direccion IPv6 del cliente

3) Volver a probar conectividad con el servidor:
telnet SERVER_IPV6 80

(aca obtendrian un timeout)

(Reportes del mas alla han sugerido que un usuario pudo reproducir esto
por ejemplo probandolo entre su propia conexion y www.kernel.org)


Para probarlo contra una sesion BGP, obviamente tendrian que reemplazar
las direcciones IPv6 por la de los peers, y el puerto "80" por el
well-known por de BGP. Obviamente el impacto aca es otro (), y *no* es
recomendable que lo hagan salvo que los sistemas sena propios, tengan
contramedidas en su lugar, y sepan lo que están haciendo.

Comentarios, feedback y demas (ya sea on- o off-list) son bienvenidos.

Saludos cordiales,
-- 
Fernando Gont
SI6 Networks
e-mail: fgont at si6networks.com
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492







More information about the LACTF mailing list