ADR-0049: AWS WAF stays on Hold for input that only a parser reads#

  • Status: proposed. Would narrow the radar condition set from ADR-0009.
  • Date: 2026-12-01

Context#

The radar holds AWS WAF until "any dynamic, authenticated or user-input-accepting endpoint". /api/whoami has been a dynamic endpoint all along, so that wording has been met without being applied. ADR-0009's own trigger is narrower: input that reaches a data store, a template or a shell; authentication; or abuse the free tier and budget do not contain. It also names a DoH endpoint parsing wire format as "exactly the kind of thing that changes this answer".

ADR-0048 proposes that endpoint, so the question is due. Its input is one base64url parameter, decoded into a binary DNS question that a standard-library parser either refuses or turns into a fresh query to fixed nameservers. Nothing reads it as text, SQL, markup or a path.

Pricing has moved as well. On pay-as-you-go, a web ACL is $5 a month, plus $1 per rule and $0.60 per million requests. CloudFront's flat-rate plans bundle WAF with no overage charges: the Free plan is $0 for one distribution, with a 1M-request allowance and five WAF rules, IP rate limiting among them. Below the Business plan, $200 a month, a distribution may use only AWS's managed cache, origin request and response headers policies.

Decision#

  1. WAF stays on Hold, for the DoH endpoint too. Its protection is ADR-0048's: an allowlist parser shown to fail on hostile input, refusal of anything out of scope, reserved concurrency, and a distribution of its own.
  2. The Hold condition becomes: an endpoint whose input reaches a data store, template, shell or interpreter, or a destination the input chooses; authentication; or a flood the budget tripwire does not contain. Being dynamic, or accepting input, no longer trips it on its own. Instead, each endpoint that accepts input needs an ADR naming its parser, its tests and its cost cap.
  3. Flat-rate plans are assessed separately, on the radar, starting with the DoH endpoint's distribution. A ceiling on request charges is the one thing that bundled pricing offers and ADR-0048's design lacks.

Why WAF does not help here#

  • Managed rules look for attacks written as HTTP text: SQL, script, path traversal, known bad inputs. Base64url DNS contains none, so a match could only be chance, refusing a real query.
  • Rate-based rules count per client address, and a flood from many addresses passes them.
  • On pay-as-you-go it costs about $6 a month, four times the rest of the stack, and adds $0.60 per million requests to a flood rather than capping it.

Alternatives considered#

WAF on pay-as-you-go for the DoH distribution only. It defends a binary parser against attacks aimed at other kinds of software, and makes a flood dearer.

WAF through the Free flat-rate plan. $0, and it would cap CloudFront's request charges, which reserved concurrency cannot. Not decided here:

  • it trades the narrow forwarding and cache contracts (principle 10) for managed policies that forward more than the function reads;
  • whether it allows TLSv1.3_2025, and how its one apex domain per plan treats a host under the site's domain, have not been checked;
  • its allowance is soft: sustained excess means delivery "might be adjusted".

Those are questions for an assessment, not reasons to adopt WAF (decision 3).

Keep the condition as written, and adopt WAF whenever it trips. It has been met since /api/whoami and not applied. A condition nobody applies records nothing.

Consequences#

Positive: the Hold condition says what would change the answer, so the monthly radar review can check it against each new endpoint.

Negative: the first endpoint here to accept input ships with no filtering at the edge. Its defence is code and tests in this repository, whose failures are this project's. On pay-as-you-go, a flood's request charges still have no hard ceiling.

Neutral: ADR-0009 stands; this changes only the radar's condition. Adding WAF later is still one argument on a distribution and a web ACL.

Revisit when#

  • An endpoint's input reaches anything that interprets it beyond a fixed parser.
  • A flood arrives that the budget tripwire does not contain.
  • The flat-rate assessment ends in adoption. WAF then comes with the plan, and the question becomes which rules earn a place.
  • AWS offers managed rules for DNS messages.

Built 2026-12-01 from commit 5f3eb2c4b04f9d8367364b6f4598a05a364e2263. This page was generated from the same source that provisions the infrastructure it describes.