PPP "deny_incoming" does not correctly deny incoming packets (Patch available)
19 Nov. 2000
Summary
The ppp(8) utility includes network address translation functionality for translating between public and private IP address ranges. It uses the libalias library to perform translation services. A vulnerability allows remote users to cause incoming traffic that is not part of an existing NAT session to pass the NAT gateway, which may constitute a breach of security policy.
The "nat deny_incoming" command is documented as "refusing all incoming connections" and is commonly used as a simple "firewall" to prevent outside users from connecting to services on the internal network. However the behavior of the ppp code was changed in the 4.x and 3.x branches prior to the release of FreeBSD 4.1 and 3.5 (on 2000-06-05 and 2000-06-03 respectively) to allow passing of packets which are not understood, such as IPSEC packets and other IP protocol traffic not explicitly recognized by the code as being an "incoming connection attempt". While this was arguably incorrect behavior in itself, the code also incorrectly allowed through ALL incoming traffic, effectively turning "deny_incoming" into a no-op.
Thus, users who are using the deny_incoming functionality in the expectation that it provides a "deny by default" firewall which only allows through packets known to be part of an existing NAT session, are in fact allowing other types of unsolicited IP traffic into their internal network.
The behavior of ppp was corrected to only allow incoming packets that are known to be part of a valid NAT session, which gives the desired packet filtering behavior in the general case. Outgoing IP traffic which is not understood by libalias (such as an outgoing IPSEC packet part of a VPN) will cause a NAT session to be established which will allow incoming packets with the corresponding source and destination IP addresses and protocol number to pass, but all others to be denied.
This behavior may be sufficient for the security needs of many users, although users with advanced filtering or security policy requirements are advised to use a more configurable packet filter such as those provided by ipfw(8) or ipf(8) which can meet their needs.
The following released versions of FreeBSD are the only releases vulnerable to this problem: 3.5, 3.5.1, 4.1, 4.1.1. It was fixed in the 4.1.1-STABLE branch prior to the release of FreeBSD 4.2-RELEASE.
Workaround:
Use a true packet filter such as ipfw(8) or ipf(8) on the PPP gateway to deny incoming traffic according to the desired security policy.
Solution:
One of the following:
1) Upgrade your vulnerable FreeBSD system to 4.1.1-STABLE or 3.5.1-STABLE after the respective correction dates.
2) Apply the patch below and recompile the relevant files: