BCP38 tester?
Matt Palmer
mpalmer at hezmatt.org
Mon Apr 1 20:33:45 UTC 2013
On Mon, Apr 01, 2013 at 12:31:05PM -0400, Jay Ashworth wrote:
> From: "Jimmy Hess" <mysidia at gmail.com>
>
> > Ah, but did you actually test your guess on a reasonably large variety
> > of NAT platforms?
>
> He may not have, but now that I'm thinking (caffeine is a wonder drug),
> I have: I've worked on, for customers, nearly every brand of consumer
> router on the market, and all of them do outbound NAT the same way:
>
> Pick up a DHCP address from the carrier, and use that as the source IP
> on all translated outbound packets.
The key issue at hand (I believe; please correct me if I'm wrong) is that
"all translated outbound packets" may not equal "all outbound packets".
Depending on how a NAT device is configured, it may pass some packets
*untranslated*, and that allows a malicious actor behind the NAT device to
still get their spoofed traffic out.
To relate it back to something concrete, imagine this iptables rule in an
otherwise "fully open" configuration:
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o wan -j MASQUERADE
Now, spoof a packet from behind this NAT box as coming from 192.0.2.12...
what happens? It gets passed through the NAT box, *without* being NATed.
Oops.
Of course, it isn't hard to stop this sort of thing...
iptables -A INPUT ! -s 192.168.1.0/24 -i lan -j DROP
(or any number of other equivalent rules) The question is, how many
in-common-use CPEs have considered this attack vector and are actually doing
something functionally equivalent to the DROP rule above?
I don't know, because I haven't tried it, but I'd only be surprised if the
answer was "none" or "all of them".
- Matt
More information about the NANOG
mailing list