icmp-reachable
Stateful firewalls (Linux nftables and OpenBSD Packet Filter) lose the correlation between the outer ICMP packet and the inner encapsulated packet when deciding whether traffic is 'related' to an existing connection. An attacker can craft an ICMP or ICMPv6 error packet addressed to a filtered host that encapsulates a packet matching a legitimate session, so the firewall lets it through.
synacktiv.com
Published on synacktiv.com
Written by Luca Moro, Nicolas Collignon - 19/03/2019 - in Systems - Download
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the firewall builds the connection lookup key solely from the encapsulated inner packet and never checks the outer IP addresses against the inner ones, so any ICMP error whose inner packet matches a known state is tagged as related.
Impact
An attacker could bypass firewall filtering rules and deliver ICMP or ICMPv6 packets to a host that should be unreachable from the untrusted network; the authors note NAT can affect exploitability.
What the attacker needed
Attacker on the untrusted network; a known legitimate session between two hosts; firewall using nftables or Packet Filter
How it was found
- Set up a firewall between a WAN and a LAN with a rule allowing LAN hosts to reach WAN hosts on a chosen UDP port and allowing related traffic back.
- Establish a legitimate session between a LAN host and a WAN host so a connection state exists.
- Craft an ICMP error packet from the attacker to a filtered LAN host that encapsulates the inner IP and UDP headers of that legitimate session.
- Send the crafted packet and observe that the firewall marks it related and allows it through to the filtered host.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A firewall can keep track of connections so that replies and error messages belonging to a connection you started are allowed back in. This article shows that for ICMP error messages, the firewall only checks the packet buried inside the message and ignores who the message is really addressed to. That means an attacker can wrap a harmless-looking inner packet in an error message aimed at a protected machine and slip it past the filter.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.