Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Disable ip_allowsrcrt and ip_forwsrcrt. Enabling...



details:   https://anonhg.NetBSD.org/src/rev/198e50ae53b8
branches:  trunk
changeset: 829540:198e50ae53b8
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Feb 05 13:23:11 2018 +0000

description:
Disable ip_allowsrcrt and ip_forwsrcrt. Enabling them by default was a
completely dumb idea, because they have security implications.

By sending an IPv4 packet containing an LSRR option, an attacker will
cause the system to forward the packet to another IPv4 address - and
this way he white-washes the source of the packet.

It is also possible for an attacker to reach hidden networks: if a server
has a public address, and a private one on an internal network (network
which has several internal machines connected), the attacker can send a
packet with:

        source = 0.0.0.0
        destination = public address of the server
        LSRR first address = address of a machine on the internal network

And the packet will be forwarded, by the server, to the internal machine,
in some cases even with the internal IP address of the server as a source.

diffstat:

 sys/netinet/ip_input.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r dcb4963699fc -r 198e50ae53b8 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c    Mon Feb 05 13:04:56 2018 +0000
+++ b/sys/netinet/ip_input.c    Mon Feb 05 13:23:11 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_input.c,v 1.365 2018/02/05 13:04:56 maxv Exp $      */
+/*     $NetBSD: ip_input.c,v 1.366 2018/02/05 13:23:11 maxv Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.365 2018/02/05 13:04:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.366 2018/02/05 13:23:11 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -161,10 +161,10 @@
 #define        IPSENDREDIRECTS 1
 #endif
 #ifndef IPFORWSRCRT
-#define        IPFORWSRCRT     1       /* forward source-routed packets */
+#define        IPFORWSRCRT     0       /* forward source-routed packets */
 #endif
 #ifndef IPALLOWSRCRT
-#define        IPALLOWSRCRT    1       /* allow source-routed packets */
+#define        IPALLOWSRCRT    0       /* allow source-routed packets */
 #endif
 #ifndef IPMTUDISC
 #define IPMTUDISC      1



Home | Main Index | Thread Index | Old Index