netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, linux-sctp@vger.kernel.org,
	Vlad Yasevich <vyasevich@gmail.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	mkubecek@suse.cz
Subject: Re: [PATCH] netfilter: nf_ct_sctp: validate vtag for new conntrack entries
Date: Wed, 30 Dec 2015 09:49:18 -0200	[thread overview]
Message-ID: <20151230114918.GA16270@localhost.localdomain> (raw)
In-Reply-To: <20151230000317.GA1480@salvia>

Hi there,

On Wed, Dec 30, 2015 at 01:03:17AM +0100, Pablo Neira Ayuso wrote:
> Hi Marcelo,
> 
> On Thu, Dec 24, 2015 at 10:50:28AM -0200, Marcelo Ricardo Leitner wrote:
> > I can see how it would work for the vtag-tracking scenario, I think. I'm
> > just not seeing the non-tracking one (routers in the middle) yet.
> > It doesn't seem it can fit the helper way because it can't prepare
> > expectations as it doesn't see the packets in the initial path,
> > meaning that we would have to have 2 ways of handling such new
> > entries.
> 
> We assume that conntrack sees all traffic in our existing helpers,
> think of tcp. Otherwise, we may classify packets as invalid if we
> don't all packets that belong to the flow.

Yes, okay.

> > It would work like: if the helper is not present, allow heartbeats with any
> > vtag like it currently is. Otherwise, for validating vtag too, only allow
> > them via expectations.
> 
> I'm starting to think the lazy multihoming support is problematic
> since you can actually allow pushing holes into the firewall, how easy
> would be to push holes with this mode?

Please don't. Currently there is no other way to do it. The check I want
to add only works on a corner case of what we already have, on which we
can do better. It's just that. The way Michal handled the state
transitions is very good and the fact that the conntrack entries are
created as NEW, makes them pass the same user validation rules as a real
new association would do. So there can't be any hitch-hicking...

And for vtag probing, that's not an issue either because SCTP just drops
such heartbeat requests with invalid vtags (at sctp_sf_beat_8_3).

The only vector of attack I can think of that the initial multi-homing
support would allow is a DoS, a flood of incoming heartbeat requests.
Such flood would _not_ end up on the association buffer because if the
transport tuple (src ip, dst ip, src port, dst port) doesn't match a
known association, it's discarded. It's just as any other DoS, but as
they pass the same user validation rules, there should be rules
restricting the rate or IP range or something like that if user is
worried with that. Nothing that could jeopardize the original
association.

Note that the transport validation is performed before the vtag one, and
the stack behavior is to also drop out of the blue packets silently.
Meaning that even if the attacker get a hit at the 32-bit vtag, it will
be discarded by the transport validation firstly.

So what my patch add to it, it pulls/adds this vtag check to an earlier
moment, from the stack itself to the firewall, so that the peer
firewall will be a bit more stateful.

> You can probably achieve the same effect by allowing heartbearts go
> through via NOTRACK and then have some connection pickup from the
> middle feature. That, however, would make the user fully aware of the
> limitations since it would require explicit configuration.

Interesting idea, thanks.


  reply	other threads:[~2015-12-30 11:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 13:11 [PATCH] netfilter: nf_ct_sctp: validate vtag for new conntrack entries Marcelo Ricardo Leitner
2015-12-10 12:02 ` Pablo Neira Ayuso
2015-12-10 13:16   ` Marcelo Ricardo Leitner
2015-12-10 13:42     ` Pablo Neira Ayuso
2015-12-10 14:06       ` Marcelo Ricardo Leitner
2015-12-10 17:06         ` Pablo Neira Ayuso
2015-12-15 19:03           ` Marcelo Ricardo Leitner
2015-12-17 11:05             ` Pablo Neira Ayuso
2015-12-24 12:50               ` Marcelo Ricardo Leitner
2015-12-30  0:03                 ` Pablo Neira Ayuso
2015-12-30 11:49                   ` Marcelo Ricardo Leitner [this message]
2016-01-04 12:11                     ` Pablo Neira Ayuso

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=20151230114918.GA16270@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=pablo@netfilter.org \
    --cc=vyasevich@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).