All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emmanuel Fleury <fleury@cs.auc.dk>
To: netfilter-devel@lists.samba.org
Subject: Re: Security flaw in Stateful filtering ??????
Date: Fri, 07 Jun 2002 10:15:26 +0200	[thread overview]
Message-ID: <3D006B9E.1040809@cs.auc.dk> (raw)
In-Reply-To: E17G6im-0000FK-00@wagner.rustcorp.com.au

Hi,

Rusty Russell wrote:
> 
> 	I disagree.  Consider the original complaint: that --state NEW
> allowed TCP ACK packets through, which allowed an ack scan.  This
> surprised the observers, who then blocked acks.

Precisely.

Actually, my exact complain is now that the documentation is not
making you awared of what you are exactly doing...

Somehow, this is dangerous and can lead you to have a flaw in your
firewall without being awared of it.

Moreover, most of the papers, articles, and web pages about Netfilter
are wrong about this.

Just as an example, the following (very nice) documentation about
Netfilter (http://www.knowplace.org/netfilter/index.html), state
that:

"Note: An ACK packet is a TCP packet with the ACK flag set only. The 
important thing to note here is that after the three-way handshake is 
completed, and the connection is complete, every packet that is part of 
this TCP connection will always have the ACK bit set.

This is also the reason why connection tracking is so important. Without 
connection tracking, there is no way for your firewall to know whether 
an arriving ACK packet is really a part of an established connection. 
When simple packet filters (and Ipchains) receives a packet with the ACK 
flag set, it simply allows the packet through (does this sound like a 
good idea?). When a stateful firewall received an ACK packet, it'll 
consult a connection table to see if the packet belongs to an 
established connection. If it does not, the packet is dropped."

See: http://www.knowplace.org/netfilter/ip_overview.html

Which is obviously wrong in respect of what we were discussing...

I think that this is due (as Rusty said) to a confusion between the
TCP protocol's states and the connection tracking module's states
which are different.

This should definitely be emphased in the documentation (IMHO).


The other points are more about the policy you want to apply for
the development of Netfilter. I mean, should it be left up to
the user to patch this in the ruleset or fixed in the code...

This could be discussed forever without any result.
Therefore, it makes no point to just keep going on this way.


It appears, also, to me that you are focusing more on an
"advanced NAT", than on real "stateful inspection". You agreed
on loosing some stateful key features to increase the connectivity
because as you are using stateful inspection to do NAT, the features
that you loose does not affect so much the security of your network.
But loosing this feature prevent you to use Netfilter as a real
stateful inspection firewall (I'll explain this point later in this
post).

Actually, this discussion start to make aware of the difference
between "connection tracking" and "stateful inspection". :-)


> 	Of course, you can still use SYNs to scan the network, so they
> haven't actually won anything here, except that if their firewall
> reboots, established connections will die.

Well, if you consider a full implementation of a stateful inspection
firewall, you should be able to "hide" a network from outside without
using NAT.

For example, you can make up the following ruleset:

o DENY SYN from outside -> inside
o Allow NEW, ESTABLISHED, RELATED

                       +-----------+
+--------+    +--+    | Hidden Net|
|Internet|----|FW|----| w/o NAT   |
+--------+    +--+    +-----------+

On this configuration, you allow all the computers of your hidden net
to have their own IP address and you disallow any sort of scan from
outside. You can even imagine to have a web server somewhere in your
hidden network (you just have to add as first rule that you allow
all the traffic on the port 80 to this precise IP address).

This configuration can't be done with Netfilter because you are doing
what we could call "connection tracking" and not "stateful inspection".


> 	The confusion here comes from the "TCP connection" vs
> "connection tracking connection" distinction, which is subtle and
> usually harmless.

Harmless if you are running NAT. But, if you are trying to use Netfilter
as a complete stateful inspection firewall, then you are in trouble
(IMHO).

> Hope that helps,

Yes. Thanks. :-)

Regards
-- 
Emmanuel

Security is a process, not a product.
   -- Bruce Schneier (Crypto-gram, February 15, 2002)

  parent reply	other threads:[~2002-06-07  8:15 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020606220914.A14542@groar.org>
2002-06-06 23:31 ` Security flaw in Stateful filtering ?????? Rusty Russell
2002-06-06 23:52   ` Joerg Mayer
2002-06-07  2:10     ` Rusty Russell
2002-06-07  2:53       ` Joerg Mayer
2002-06-07 12:45         ` Marcus Sundberg
2002-06-07 14:36       ` Henrik Nordstrom
2002-06-07 21:48     ` Ben Reser
2002-06-07  8:15   ` Emmanuel Fleury [this message]
2002-06-07  8:50     ` Oskar Andreasson
2002-06-07 12:27       ` Jozsef Kadlecsik
2002-06-10  8:04         ` Oskar Andreasson
2002-06-10  8:26           ` Emmanuel Fleury
2002-06-12  9:23           ` Jozsef Kadlecsik
2002-06-07  9:05     ` Henrik Nordstrom
2002-06-07  9:31       ` Emmanuel Fleury
2002-06-07  9:41         ` Oskar Andreasson
2002-06-07  9:43         ` Guillaume Morin
2002-06-07  9:57           ` Emmanuel Fleury
2002-06-07 10:17             ` Guillaume Morin
2002-06-07 11:30               ` Emmanuel Fleury
2002-06-07 13:33                 ` Guillaume Morin
2002-06-07 15:13                   ` Emmanuel Fleury
2002-06-07 18:36                     ` Guillaume Morin
2002-06-07 19:00                       ` Patrick Schaaf
2002-06-08  2:06                         ` Emmanuel Fleury
2002-06-08  8:21                           ` Patrick Schaaf
2002-06-08 12:02                             ` Henrik Nordstrom
2002-06-09  7:03                               ` Emmanuel Fleury
2002-06-09  8:29                                 ` Patrick Schaaf
2002-06-08  1:42                       ` Emmanuel Fleury
2002-06-07 10:17             ` Henrik Nordstrom
2002-06-07 10:11         ` Henrik Nordstrom
2002-06-07 22:02     ` Ben Reser
2002-06-08  2:13       ` Emmanuel Fleury
2002-06-08  8:23         ` Patrick Schaaf
2002-06-08 16:41         ` Ben Reser
2002-06-08  9:07       ` ACK is NEW: Conclusion ? (was:Re: Security flaw in Stateful filtering ??????) Emmanuel Fleury
2002-06-07  9:42 Security flaw in Stateful filtering ?????? Mikkel Christiansen
2002-06-08  7:44 ` Harald Welte
  -- strict thread matches above, loose matches on Subject: below --
2002-06-06 22:15 Andy Whitcroft
2002-06-06 19:29 Sneppe Filip
2002-06-06 17:21 Emmanuel Fleury
2002-06-06 17:48 ` Martin Josefsson
2002-06-06 17:54 ` Maciej Soltysiak
2002-06-06 18:52   ` Emmanuel Fleury
2002-06-06 19:11     ` Maciej Soltysiak
2002-06-06 19:30     ` Guillaume Morin
2002-06-06 19:53       ` Patrick Schaaf
2002-06-06 19:43     ` Henrik Nordstrom
2002-06-06 17:57 ` Patrick Schaaf
2002-06-06 18:34   ` Emmanuel Fleury
2002-06-06 19:12     ` Patrick Schaaf
2002-06-06 19:28       ` Emmanuel Fleury
2002-06-06 19:27     ` Henrik Nordstrom
2002-06-06 20:50       ` Emmanuel Fleury
2002-06-06 21:26         ` Henrik Nordstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D006B9E.1040809@cs.auc.dk \
    --to=fleury@cs.auc.dk \
    --cc=netfilter-devel@lists.samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.