Section 1.14

Fail open

Definition

Fail open describes a component that lets a protected operation go ahead when the security check that normally guards the operation cannot complete. An error, a timeout §9.34, a crash of the checking component or missing data then has the same result as an explicit allow. The opposite design, fail closed §1.13, refuses in those cases. Failing open keeps the service available during the failure, at the price of the protection that the check supplies. Whoever can cause the failure, an attacker included, can therefore switch that protection off.

The idea

A building secures a door on an escape route with an electromagnetic lock, a magnet that holds the door shut only while it has power. During a fire the power fails and the door opens. A locked door would trap people inside; an open door lets anyone walk in while the building burns. Fire safety rules for such doors choose the open door, because a person trapped in a fire is far worse than an intruder during an emergency. The choice has a known cost: if the doors also unlock whenever the fire alarm sounds, anyone who pulls an alarm handle can open them, and the building must cover that risk another way.

The same choice appears in software. A gateway checks the authentication §1.6 tag on every command before passing the command to a device. The tag is a short value computed with a secret key, and the gateway asks a key server across the network to verify it. The key server stops answering. A fail-open gateway passes commands unchecked until the server returns. If the server fails only by accident, few commands pass unchecked and almost none of them are malicious. If an attacker can make the server unreachable, for example by flooding its network link with traffic, the attacker first causes the outage and then sends commands that no key holder made. The failure has become the attack.

Failing open turns “the check could not run” into permission. The check then protects only as long as nobody who wants to get past it can stop it from running. Whether that is acceptable depends on the threat model §1.2, the written account of what an attacker can do and wants: who can cause the failure, and what they gain from the operations that pass while the check is down.

How it works

Fail open is either a design decision or a bug. As a bug, it comes from an error path that nobody thought about, such as a return value meaning “could not check” that the caller treats as success. As a design decision, it is written down and answers six questions.

  1. What is waived. Name the operation, the check and the protection that the check supplies, for example “commands are accepted only from key holders”.

  2. Which failures trigger the fallback, such as a timeout, a crash, an unreachable server or missing data, and who can cause each one: a random fault, an insider or a remote attacker.

  3. What the fallback allows. Either every request, or only a narrow set: read-only requests, one fixed emergency action, or running the last configuration that passed its checks.

  4. How long the fallback lasts. A time limit or a count limit, after which the component fails closed.

  5. How the fallback is seen. Every use of the fallback is logged and raises an alarm, and a rising rate of failures is treated as a possible attack.

  6. How the fallback ends. Normal checking resumes as soon as the check works again, and the requests that passed unchecked are reviewed afterwards wherever a record of them exists.

A fallback that the rules themselves permit is not fail open. If the rules say that an access decision stays valid for ten minutes, a component that reuses a five-minute-old decision while the decision server is down is following the rules, and the protection is the one the rules promise. The same component reusing a decision that is two hours old, because nothing newer is available, fails open. The label matters less than the contract: write down which protection stays in force during the failure and which is waived.

Components that only observe usually fail open by nature. A monitoring tool that copies network traffic for later analysis never blocked anything, so when the tool crashes the traffic keeps flowing and only the record is lost. The loss is missing evidence, not missing enforcement, and a conclusion drawn from the record, such as “no attack occurred”, must account for the gaps. Devices that sit in the traffic path and block attacks, such as intrusion prevention systems, are often installed with a bypass that passes traffic uninspected when the device fails, because the operator judges that losing the whole network costs more than a period without inspection.

Worked example

Certificate revocation on the web is the classic case. A web server proves its identity with a certificate: a statement, signed by a certificate authority (an organization that browsers trust), that binds the server’s name to the server’s public key. If the server’s private key is stolen, the authority revokes the certificate, which means it declares the certificate invalid before the certificate’s expiry date. A browser can ask the authority’s status server whether a certificate has been revoked, using OCSP (Online Certificate Status Protocol). Browsers that make this query have typically treated a status server that does not answer as a pass, a practice called soft-fail: the connection goes ahead.

Suppose the status server fails to answer 1% of queries because of random outages, and a site receives 1,000,000 connections a day.

The 99% figure measures protection against accidents. Against the one attacker the check exists for, soft-fail gives no protection, because that attacker controls the failure. One repair keeps availability §1.10 without failing open by moving the status answer into the connection itself. The web server attaches a recent status answer signed by the authority, which is called OCSP stapling, and the certificate states that a connection without such an answer must be refused, which is called must-staple. The browser then needs no separate query that an attacker could block.

Stated precisely

For a request rr, let v(r)v(r) be the verdict that the check produces for rr in the current attempt. It takes one of three values: allow, deny, or none, where none means that the check did not finish. An unbounded fail-open component satisfies the protected effect happens for r⇔v(r)≠deny.\text{the protected effect happens for } r \iff v(r) \ne \text{deny}. A bounded fail-open component also names FF, the set of requests that the fallback admits, and TT, the longest time the fallback may last. The effect then happens for rr exactly when v(r)=allowv(r) = \text{allow}, or when v(r)=nonev(r) = \text{none}, rr is in FF and the failure began less than TT ago. As a decision table, in which each cell says whether the protected effect happens:

verdict unbounded fail open bounded fail open
allow happens happens
deny refused refused
none, rr in FF, within TT happens happens
none, otherwise happens refused

A fail-open choice is justified only when three conditions hold. The first two must be argued from the threat model, not taken for granted; the third is a requirement on the design.

  1. No profitable trigger. No attacker in the threat model can make v(r)=nonev(r) = \text{none} for a request rr of the attacker’s choosing, or no request in FF gives an attacker the effect that the check protects.

  2. Smaller harm. Over a failure lasting up to TT, the harm of letting the requests in FF through unchecked is smaller than the harm of refusing them.

  3. Visible fallback. Every use of the fallback is recorded, so that failures that become frequent are noticed and treated as a possible attack.

Any security claim that rests on the check holds only for requests whose verdict was allow or deny. For requests admitted with the verdict none, the check claims nothing.

Limits and common mistakes

The fatal mistake is a failure that the attacker can trigger. Malformed input that crashes the checker, a flood that delays an answer past its timeout, a cut network link, exhausted memory and corrupted storage are all failures an outsider may be able to cause. A fail-open check with such a trigger is a check with a public off switch.

Fail open often happens by accident. A check that returns 1 for valid, 0 for invalid and −1-1 for “could not run”, called as if (check(m) != 0) accept(m), accepts the message on −1-1. An accidental fail-open path is a bug, whatever the intended design.

Fail open does not guarantee availability. Operations admitted unchecked during the failure can themselves damage the service, for example by installing broken settings.

The words fail-safe and fail-secure do not settle the question. In safety engineering, fail-safe means safe for people, which for a door on an escape route means open. In computer security, the principle of fail-safe defaults means deny unless access was explicitly granted, which is close to fail closed. Always state which effect happens on failure.

A design that fails open must not be described as enforcing the check during failures. “Every command is authenticated” is false for a fail-open gateway; the true statement is “every command is authenticated while the key server answers”.

Questions answered

Under which threat model is a fail-open choice justified?

A fail-open choice is justified only under a threat model in which no attacker who would profit from the protected operation can cause the failure that opens it, or in which the operations allowed during the failure cannot give an attacker the effect that the check protects. Fail open means that a protected operation goes ahead when its security check cannot complete; a threat model is the written account of what an attacker can do and wants. Two further conditions must hold: refusing the operations during a failure must cost more than letting them through unchecked, and the fallback must be limited in scope and in time, and recorded.

Typical justified cases are failures caused only by accidents, such as power loss or hardware faults, where refusing endangers people or stops a critical service: doors on escape routes that open in a fire, or a monitoring tool whose crash must not stop the traffic it observes. The choice is not justified when the threat model includes an attacker who can cause the failure, for example by flooding a server, cutting a network link, corrupting storage or sending input that crashes the checker, and who then gains the protected effect. For that attacker the check has an off switch. The operation should then fail closed, keeping available only the operations that do not depend on the check, such as running the last configuration that passed its checks.

Related entries: Fail closed (§1.13), Policy versus mechanism (§1.19), Recovery authority (§1.46), Threat model (§1.2), Denial of service (DoS) (§1.28).