* Re: TCP-RST Vulnerability - Doubt
2004-06-28 13:22 ` Miquel van Smoorenburg
@ 2004-06-28 14:49 ` Chris Wedgwood
2004-06-28 18:34 ` Florian Weimer
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: Chris Wedgwood @ 2004-06-28 14:49 UTC (permalink / raw)
To: Miquel van Smoorenburg; +Cc: linux-kernel
On Mon, Jun 28, 2004 at 01:22:37PM +0000, Miquel van Smoorenburg wrote:
> The "TTL hack" solution is safer. Make sure sender uses a TTL of
> 255, on the receiver discard all packets with a TTL < 255. You can
> use iptables to implement that on a Linux box.
Breaks with eBGP multi-hop so you have to adjust as required there.
--cw
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: TCP-RST Vulnerability - Doubt
2004-06-28 13:22 ` Miquel van Smoorenburg
2004-06-28 14:49 ` Chris Wedgwood
@ 2004-06-28 18:34 ` Florian Weimer
2004-06-28 18:37 ` Willy Tarreau
2004-06-29 2:34 ` Daniel Roesen
3 siblings, 0 replies; 16+ messages in thread
From: Florian Weimer @ 2004-06-28 18:34 UTC (permalink / raw)
To: Miquel van Smoorenburg; +Cc: linux-kernel
* Miquel van Smoorenburg:
> MD5 protection on BGP sessions isn't very common yet.
Well, there was quite some technology push recently. 8-)
> MD5 uses CPU, and routers don't usually have much of that. Which
> means that now an MD5 CPU attack is possible instead of a TCP RST
> attack.
Anything that is able to send packets to the CPU which runs the TCP
stack can take down your router. Core routers with 200 MHz MIPS CPUs
are still common. It really doesn't matter much if you have to do a
MD5 check or not, the CPU will be easy to overload. However, the TCP
MD5 option is a nice thing to have because you can enable it and avoid
discussions (just like you do it with antivirus software 8-/).
Part of the beauty of the TTL hack is that it actually works in
linecard CPUs or ASICs on some routing architectures, which takes the
load off the main CPU. For Linux, you can also drop the packets
before they hit the route cache, which might be become more important
in the future when the route cache is no longer used for forwarding.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: TCP-RST Vulnerability - Doubt
2004-06-28 13:22 ` Miquel van Smoorenburg
2004-06-28 14:49 ` Chris Wedgwood
2004-06-28 18:34 ` Florian Weimer
@ 2004-06-28 18:37 ` Willy Tarreau
2004-06-28 19:26 ` Florian Weimer
2004-06-29 2:34 ` Daniel Roesen
3 siblings, 1 reply; 16+ messages in thread
From: Willy Tarreau @ 2004-06-28 18:37 UTC (permalink / raw)
To: Miquel van Smoorenburg; +Cc: linux-kernel
On Mon, Jun 28, 2004 at 01:22:37PM +0000, Miquel van Smoorenburg wrote:
>
> MD5 protection on BGP sessions isn't very common yet.
The Cisco routers we deployed 3.5 years ago were already configured with MD5
enabled on BGP, this was on IOS 12.0 at this time. And I guess that Cisco
still has a good share amongst the BGP setups.
> MD5 uses CPU,
> and routers don't usually have much of that. Which means that now an
> MD5 CPU attack is possible instead of a TCP RST attack.
MD5 is not that much expensive. I even wonder if all those new routers
with VPN hardware acceleration, MD5 could not be computed in hardware
at nearly no cost.
> The "TTL hack" solution is safer. Make sure sender uses a TTL
> of 255, on the receiver discard all packets with a TTL < 255.
> You can use iptables to implement that on a Linux box.
This will not work in an eBGP multi-hop setup. However, you can often
still discard packets with a TTL < 252 or something like that, which
might imply a packet from outside the provider's area.
But the real problem is that the provider should do the anti-spoofing
himself and not accept BGP packets from the wrong NIC ! And it's relatively
easy to show them where they're bad.
Regards,
Willy
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: TCP-RST Vulnerability - Doubt
2004-06-28 18:37 ` Willy Tarreau
@ 2004-06-28 19:26 ` Florian Weimer
2004-06-29 20:03 ` Valdis.Kletnieks
0 siblings, 1 reply; 16+ messages in thread
From: Florian Weimer @ 2004-06-28 19:26 UTC (permalink / raw)
To: Willy Tarreau; +Cc: Miquel van Smoorenburg, linux-kernel
* Willy Tarreau:
> On Mon, Jun 28, 2004 at 01:22:37PM +0000, Miquel van Smoorenburg wrote:
>>
>> MD5 protection on BGP sessions isn't very common yet.
>
> The Cisco routers we deployed 3.5 years ago were already configured with MD5
> enabled on BGP, this was on IOS 12.0 at this time. And I guess that Cisco
> still has a good share amongst the BGP setups.
Software deployed /= configured & enabled.
One of the main problems with the TCP MD5 option is that it requires a
password which has to be negotiated by the peers. This adds a
non-trivial management burdern.
> MD5 is not that much expensive. I even wonder if all those new routers
> with VPN hardware acceleration, MD5 could not be computed in hardware
> at nearly no cost.
If the packet is still handled by a real CPU (which is very likely the
case given the complexity of the protocols involved), it will still
overload.
> But the real problem is that the provider should do the
> anti-spoofing himself and not accept BGP packets from the wrong NIC
> ! And it's relatively easy to show them where they're bad.
In this case, the anti-spoofing has to happen at the other side, to
protect you. There is an anomaly in Cisco ACLs you could exploit to
implement this without too much management overhead, *but* filtering
on core routers still problematic.
However, experience tells us that there is little incentive for others
to invest some work to protect you, and that it doesn't happen in
general. 8-(
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: TCP-RST Vulnerability - Doubt
2004-06-28 19:26 ` Florian Weimer
@ 2004-06-29 20:03 ` Valdis.Kletnieks
2004-06-29 21:22 ` Florian Weimer
0 siblings, 1 reply; 16+ messages in thread
From: Valdis.Kletnieks @ 2004-06-29 20:03 UTC (permalink / raw)
To: Florian Weimer; +Cc: Willy Tarreau, Miquel van Smoorenburg, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]
On Mon, 28 Jun 2004 21:26:07 +0200, Florian Weimer said:
> > The Cisco routers we deployed 3.5 years ago were already configured with MD
5
> > enabled on BGP, this was on IOS 12.0 at this time. And I guess that Cisco
> > still has a good share amongst the BGP setups.
>
> Software deployed /= configured & enabled.
>
> One of the main problems with the TCP MD5 option is that it requires a
> password which has to be negotiated by the peers. This adds a
> non-trivial management burdern.
The latest numbers I saw on the NANOG list estimated that only 30% to 40% of
core peerings were using MD5 even several weeks after the Great MD5-Fest...
> If the packet is still handled by a real CPU (which is very likely the
> case given the complexity of the protocols involved), it will still
> overload.
I am told that at least some versions of IOS got it Very Very Wrong - rather
than first checking the simple things like "is the source/dest addr/ports/seq
on the RST in bounds?" or "is a BGP packet?", it would check the MD5 *first* -
meaning you could swamp the real CPU by sending it a totally bogus stream of
allegedly MD5-signed traffic.. which of course would induce a route flap
when the CPU fell too far behind... ;)
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: TCP-RST Vulnerability - Doubt
2004-06-29 20:03 ` Valdis.Kletnieks
@ 2004-06-29 21:22 ` Florian Weimer
2004-06-29 21:45 ` Valdis.Kletnieks
0 siblings, 1 reply; 16+ messages in thread
From: Florian Weimer @ 2004-06-29 21:22 UTC (permalink / raw)
To: Valdis.Kletnieks; +Cc: Willy Tarreau, Miquel van Smoorenburg, linux-kernel
* Valdis Kletnieks:
> The latest numbers I saw on the NANOG list estimated that only 30%
> to 40% of core peerings were using MD5 even several weeks after the
> Great MD5-Fest...
30% to 40% is extremely high. Are you sure these numbers are correct?
> I am told that at least some versions of IOS got it Very Very Wrong
> - rather than first checking the simple things like "is the
> source/dest addr/ports/seq on the RST in bounds?" or "is a BGP
> packet?", it would check the MD5 *first* - meaning you could swamp
> the real CPU by sending it a totally bogus stream of allegedly
> MD5-signed traffic..
I think the MD5 option is designed to be processed *before* semantic
analysis of the TCP header. This way, it will protect the router in
case of TCP header parsing bugs. So it's not "Very Very Wrong", just
a different trade-off.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: TCP-RST Vulnerability - Doubt
2004-06-29 21:22 ` Florian Weimer
@ 2004-06-29 21:45 ` Valdis.Kletnieks
0 siblings, 0 replies; 16+ messages in thread
From: Valdis.Kletnieks @ 2004-06-29 21:45 UTC (permalink / raw)
To: Florian Weimer; +Cc: Willy Tarreau, Miquel van Smoorenburg, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
On Tue, 29 Jun 2004 23:22:56 +0200, Florian Weimer said:
> * Valdis Kletnieks:
>
> > The latest numbers I saw on the NANOG list estimated that only 30%
> > to 40% of core peerings were using MD5 even several weeks after the
> > Great MD5-Fest...
>
> 30% to 40% is extremely high. Are you sure these numbers are correct?
Well, here's the start of the thread...
http://www.merit.edu/mail.archives/nanog/2004-05/msg00144.html
Anywhere from 12% to 45% depending which methodology you believe in.. ;)
> I think the MD5 option is designed to be processed *before* semantic
> analysis of the TCP header. This way, it will protect the router in
> case of TCP header parsing bugs. So it's not "Very Very Wrong", just
> a different trade-off.
I saw several people who dropped hints that if it had an MD5 on it,
it got handed to the CPU for checking, without even bothering to verify
that the source IP was something you had an MD5 configured for.. "Hey, this
MD5 is borked! Good thing it's not from a host we talk to...." :)
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: TCP-RST Vulnerability - Doubt
2004-06-28 13:22 ` Miquel van Smoorenburg
` (2 preceding siblings ...)
2004-06-28 18:37 ` Willy Tarreau
@ 2004-06-29 2:34 ` Daniel Roesen
2004-06-29 21:28 ` Florian Weimer
3 siblings, 1 reply; 16+ messages in thread
From: Daniel Roesen @ 2004-06-29 2:34 UTC (permalink / raw)
To: linux-kernel
On Mon, Jun 28, 2004 at 01:22:37PM +0000, Miquel van Smoorenburg wrote:
> MD5 protection on BGP sessions isn't very common yet. MD5 uses CPU,
> and routers don't usually have much of that. Which means that now an
> MD5 CPU attack is possible instead of a TCP RST attack.
Not if the MD5 option is properly implemented - i.e. MD5 hash checking
is done AFTER the packet is considered valid in terms of "fitting"
sequence number.
> The "TTL hack" solution is safer. Make sure sender uses a TTL
> of 255, on the receiver discard all packets with a TTL < 255.
It's a hack, not a solution. A solution works always, not just in
some special cases (and given Cisco's implementation, even there
is a window which is "too wide open").
As this thread is fairly off-topic on lkml, I suggest moving it to
somewhere else... But then again, in the appropriate places, these
discussions have already taken place. :-)
Regards,
Daniel
^ permalink raw reply [flat|nested] 16+ messages in thread