Skip to main content
Back to blog

Firewalls: Why Is the Blocked Program Still Running?

Security

Firewalls: Why Is the Blocked Program Still Running? article illustration

A firewall holds a list of rules and applies them to traffic as it passes. Blocking a program is therefore not the same outcome as stopping one, and the distance between those two results is where the useful part of this subject sits.

What the reference documents say a firewall is

The IETF’s reference description is RFC 2979, Behavior of and Requirements for Internet Firewalls, an Informational document written by Ned Freed, published by the Internet Architecture Board in October 2000. Its definition runs to one sentence, and the verb at the centre of it is doing a great deal of work: a firewall is “an agent which screens network traffic in some way, blocking traffic it believes to be inappropriate, dangerous, or both”.

Believes, not knows. What it can form a belief about is set out a page later. Such a device, the document says, either acts “as a protocol end point and relay”, or “as a packet filter, or some combination of both”. The packet filter is the version in your house and on your laptop, and it passes a packet through, “drops the packet entirely”, or “handles the packet itself in some way”.

The grounds for that decision are narrower than the word firewall implies. “Firewalls typically base some of their decisions on IP source and destination addresses and port numbers,” RFC 2979 records, before listing examples and conceding that its own list “is by no means exhaustive”. Addresses, ports, direction. A rule can say that nothing from outside may reach this number. It has no vocabulary for saying that a thing is harmful.

One boundary is worth drawing early, because the two get sold as each other. RFC 2979 states that “firewall functions are disjoint from network address translation (NAT) functions”. A home router produces a similar visible effect through its translation table rather than through any rule about safety, so what the boundary is doing instead is a separate mechanism with separate failure modes.

Unwanted by whom

RFC 7288, Reflections on Host Firewalls, came from the same board in June 2014, written by Dave Thaler. It concedes the informal definition, that people tend to think of a firewall as “something that blocks unwanted traffic”, and then puts the question the document turns on: “unwanted by whom?”

Its answer is a list of parties rather than a principle. The candidates are “end users, application developers, network administrators, host administrators, firewall vendors, and content providers”, with one ruled out by definition, the sender, “since the sender would generally want such traffic to be delivered”. Those parties, it adds, “have different, and often conflicting, desires which means that a type of traffic might be wanted by one entity and unwanted by another entity”.

A rule list is therefore a record of somebody’s preference, and which somebody depends on where it runs. RFC 7288 separates a “host firewall”, which “simply intends to protect the single computer on which it runs”, from a “network firewall”, which “is located in the network and intends to protect the network and any hosts behind it”. Your laptop has one and the box in the hallway has the other. Different people configure them, and neither consults the other.

Blocking is not stopping

RFC 7288 sorts rules into two kinds, and the sorting is the most clarifying thing in it. There are rules for “attack surface reduction”, meaning rules “intended to prevent an application from doing things the developer does not want it to do”, and rules of “security policy”, which stop it doing things “the developer might want it to do, but an administrator does not”. From which follows one of the bluntest sentences the IAB has published on the subject: “A firewall is unnecessary if both categories are empty.”

Where a program would behave in a way you do not want, the document lays out three options. You can “fix (or get the developer to fix) the software”, you can “not use the software”, or you can “let the software run, but then use a firewall to thwart it and prevent it from working in unwanted ways”.

The third is the one people pick, and RFC 7288 is unsentimental about its price: “resources still get consumed”, among them “memory, CPU, bandwidth (up to the point of blockage), ports in the transport layer protocol”, all of it spent “for operations that provide no benefit while firewalled”. A blocked program is a running program that is getting nowhere.

The other cost is familiar to anyone who has debugged a silent failure. The document observes that “typically the application and the end-user won’t know why the application doesn’t work”. Nothing reports the block to the thing being blocked.

This is why removing a service you would rather were not reachable beats fencing it, and what has to be true for anything to be reachable sets out the other conditions a rule sits alongside.

The filtering changed the traffic it was sorting

The sequence worth following here is a prediction and its outcome, recorded across three documents from the same board.

RFC 2979 turns near its end to advice for protocol designers, with an example of what not to do. “Wrapping a new protocol around HTTP and using port 80 because it is likely to be open isn’t a good idea,” it says, “since it will eventually result in added complexity in firewall handling of port 80.” That was 2000, and it was written as a warning.

By July 2007 the IAB was recording it as history. Reflections on Internet Transparency, RFC 4924, is quoted at length inside RFC 7288, and the sentence that matters is an account of cause: “many application protocols began to use HTTP as a transport protocol after application developers observed that firewalls allow HTTP traffic while dropping packets for unknown protocols”. The same passage gives the general rule, that “filtering intended to block or restrict application usage is difficult to successfully implement without customer consent, since over time developers will tend to re-engineer filtered protocols so as to avoid the filters”.

Read those together and the causation is uncomfortable. Filtering by port number taught a generation of software to arrive on the port that was open. The policy did not fail to sort the traffic. It changed what the traffic looked like, until sorting by that criterion stopped telling anybody much.

RFC 2979 had set a rule that the crude version of this breaks, requiring that introducing a firewall “MUST NOT cause unintended failures of legitimate and standards-compliant usage that would work were the firewall not present”. RFC 7288’s verdict on that requirement, in 2014, is that many firewalls “do not follow that guidance”.

Two things a rule list does not cover

The first is the job it tends to get credited with. RFC 7288’s security considerations are explicit: “There is a common misconception that firewalls protect users from malware on their computer, when in fact firewalls protect users from buggy software.” It adds that such a device is “not invulnerable” and “will not prevent malware from running if the user allows it”. A rule about arriving traffic has no opinion about something you installed and permitted.

The second is the firewall itself. RFC 4732, the IAB’s survey of denial-of-service considerations from 2006, carries a section on firewalls whose subject is the firewall as a target. They “fall into stateful and stateless classes”, it says, the distinction being “whether the firewall holds state for the active flows traversing the firewall”, and it describes what happens to the stateful kind when that store fills: “the firewall simply runs out of memory, and can no longer instantiate the state required to pass legitimate flows. Most firewalls will then fail disconnected, causing denial-of-service to the systems behind the firewall.” The failure mode of a thing holding a list is to stop passing the traffic it was meant to protect. Filling a link instead of a state table is a different attack with a different remedy, and exhausting a link rather than a rule table covers that one.

Working out which layer said no

Two lists stand between a connection and a program, and one result from outside cannot tell them apart. The troubleshooting note on our own tool says it in a line, that router forwarding and operating system firewalls are separate settings. So when you put the question from where the traffic would arrive, what returns describes the whole path. A refusal may be the router declining to forward or the host declining to accept, and the outcome reads the same either way. Treat them as two questions.

A rule naming one address family says nothing about the other. A connection can present an IPv4 address and an IPv6 address at once, and a list written for the first governs nothing arriving over the second. Checking whether a second address exists at all comes first, because the question only arises if one does.

Expect a list to outlive the reason for it. Rules accumulate, and one added for software long since removed is indistinguishable from one still earning its place. Nothing in a firewall expires on its own.

RFC 2979 made the trade honestly in 2000, and the framing has held: “the only perfectly secure network is one that doesn’t allow any data through at all and that the only problem with such a network is that it is unusable. Anything less is necessarily a tradeoff between usability and security.” A firewall is where you record which side of that trade you have taken, for traffic described by address and port. It is a good place to record it. It is not where the software stops.