Bug #13652
closedInconsistent behavior filtering ICMP traffic
0%
Description
I have the following FLOATING rules to filter out unwanted ICMP traffic on the network (these are repeated for all interfaces in the firewall but only the WAN, em1.66, is shown here):
block drop quick on em1.66 inet proto icmp all icmp-type timereq label "USER_RULE: Discard any and all ICMP Timestamp requests" ridentifier 1667827889
block drop quick on em1.66 inet proto icmp all icmp-type maskreq label "USER_RULE: Discard any and all ICMP Address mask requests" ridentifier 1667828285
block drop out log on em1.66 inet proto icmp all icmp-type timerep label "USER_RULE: Discard any and all ICMP Outgoing Timestamp replies" ridentifier 1667764490
block drop out log on em1.66 inet proto icmp all icmp-type maskrep label "USER_RULE: Discard any and all ICMP Outgoing Address mask re..." ridentifier 1667828326
Under unknown conditions, ICMP TimeStamp requests are allowed on the network and pfSense replies. This behavior does not occur for Address Mask requests.
I can reproduce this issue using the Qualys scanners over a set of consecutive IP addresses. I have placed a network TAP (Dualcomm ETAP-PI) in front of the ISP router and the relevant capture is attached. The pfSense host is labelled pfSenseWAN and handles two virtual IPs labeled pfSenseVirt and pfSenseVirtHost.
All Address mask requests from the Qulays scanner are dropped:
157 204.410768675 QualysScanner pfSenseWANVirt ICMP 60 Address mask request id=0x118f, seq=26729/26984, ttl=245
158 204.414693012 QualysScanner pfSenseWAN ICMP 60 Address mask request id=0x1192, seq=30825/27000, ttl=245
159 204.524882130 QualysScanner pfSenseVirtHost ICMP 60 Address mask request id=0x1195, seq=18537/26952, ttl=245
These are repeated twice in the attached capture (between sequence number 160 to 179)
However, TimeStamp requests are honored by the pfSense firewall itself:
138 202.411235592 QualysScanner pfSenseWANVirt ICMP 60 Timestamp request id=0x118f, seq=26729/26984, ttl=245
139 202.411318979 pfSenseWANVirt QualysScanner ICMP 60 Timestamp reply id=0x118f, seq=26729/26984, ttl=64
140 202.414854325 QualysScanner pfSenseWAN ICMP 60 Timestamp request id=0x1192, seq=30825/27000, ttl=245
141 202.414940916 pfSenseWAN QualysScanner ICMP 60 Timestamp reply id=0x1192, seq=30825/27000, ttl=64
ICMP traffic that is NATed to an internal host is properly discarded (the second virtual IP is NATed to this host via simple NAT rules in this setup):
146 202.524821388 QualysScanner pfSenseVirtHost ICMP 60 Timestamp request id=0x1195, seq=18537/26952, ttl=245
[...]
162 210.524959887 QualysScanner pfSenseVirtHost ICMP 60 Timestamp request id=0x1195, seq=18537/26952, ttl=245
[...]
176 218.525489225 QualysScanner pfSenseVirtHost ICMP 60 Timestamp request id=0x1195, seq=18537/26952, ttl=245
Clearly, this behavior is inconsistent.
Even stranger, the inbound rules work as expected when the Qualys scanner or any other utility, such as hping3 or nmap, is used to target each host one at a time.
Also. when I disable the timereq/maskreq rules, I do not see the outgoing replies blocked in the pfSense Firewall log. My understanding is that this is the expected behavior from the above rules.
NOTE: I moved these rules to FLOATING because the behavior was the same when they were in the WAN ruleset.
Files
Related issues