skip to content

Why is a source-IP allowlist on a UDP control service not an authentication control?

level: seniorimportance: must knowfreq 58%

answer

  1. the checked value is sender-supplied
  2. no handshake, so no round trip
  3. the effect lands before any answer
  4. reachability, never identity
  5. keyed per-message authenticator instead

basics

~20 s

Because the value it checks is written by the sender. Over UDP the effect lands when the datagram arrives, so a forger never needs the reply. The allowlist constrains honest traffic and stops nobody willing to lie.

solid answer

~50 s

The allowlist compares an attacker-chosen field against a list of values, which is not a test anyone fails on purpose. UDP has no handshake, so nothing forces a sender to prove it can receive at the address it claims: one forged datagram carrying a state-changing command arrives, is accepted because the header says the right thing, and takes effect, while any answer is delivered to the real owner of that address and discarded. In front of a TCP service the same allowlist is worth more, because an off-path forger cannot complete the handshake — but what it then enforces is a position and routing assumption, not an identity. Call the control what it is: a reduction in who can reach the service, valuable as one layer, worthless as the only gate. Authentication means something the sender must possess and cannot copy out of a header: a keyed authenticator over each message with replay protection, or a mutually authenticated transport.

code

text · 9 lines
text
What the service checks          What actually happened
------------------------         ------------------------------
IP src   10.20.4.17   on list    emitted from 203.0.113.88
IP dst   10.20.4.9                nothing on the path compared
proto    UDP  dst port 161        the src field to the emitter
payload  SNMP set-request ...     the set is applied on arrival

... the answer is addressed to 10.20.4.17, the real host,
    which discards it as unsolicited

go deeper

for a junior

Learn the one-line reason: the service is checking a value the sender chose, so it filters the honest and stops nobody who is willing to lie.

for a middle

Explain why the connectionless case is the worst case, and where the answer to a forged datagram actually goes.

for a senior

Show production judgment by relabelling rather than condemning: name the control as exposure reduction, then specify the per-message authenticator that supplies the missing property.

for a principal

Be ready to hold the line on this across an estate where dozens of internal services were built on the same assumption, and to sequence the change so nothing breaks at once.

## The wrong answer this question exists to catch A competent senior engineer, asked whether an internal service is exposed, will often say: *it only accepts traffic from the application subnet, so it is fine.* The sentence sounds like an access-control statement. It is not. It is a statement about a field that the sender fills in. Spell the mechanism out. The service receives a datagram, reads the source address out of the header, compares it to a configured range, and if it matches, processes the payload. The attacker also fills in the source address in the header. They are being asked to supply the credential and then being checked against the credential they supplied. The only thing standing between a forger and the service is whether their originating network will forward a packet bearing somebody else's address — a property of a network the target does not control and cannot see. ## Why connectionless makes it total Over a connection-oriented transport there is at least a round trip, and an off-path forger cannot survive it. Over a connectionless one there is nothing. The datagram's effect is complete on arrival: the setting is changed, the entry appended, the operation triggered. Any answer the service generates is addressed to the value in the source field, so it travels to the real owner of that address, which drops it as unsolicited. The attacker does not need it and never wanted it. This is the pure one-way case — no session, no foothold, no account, just an effect they caused and cannot observe. So when someone says the service is protected because it is UDP and internal, they have named the two conditions that make the protection weakest, not strongest. ## The TCP nuance, which is worth getting right In front of a TCP service, a source allowlist does raise the bar: to complete the handshake the peer must receive the server's SYN-ACK, so an off-path attacker cannot get in. Do not overclaim from that. What has been demonstrated is that the peer can receive traffic at the allowed address — which is satisfied by anyone on-path, by any compromised host inside the allowed range, and by anything that can influence where that address's traffic goes. It is a reachability proof, not an identity proof, and it has no message integrity attached: it says nothing about whether the payload was tampered with, and gives no basis for attributing a command to a particular caller afterwards. ## The population problem An allowlisted address is rarely one machine. If it is a shared egress address — a translation gateway, a proxy, an outbound cluster — the entry vouches for every host behind it. The real subject of the control is a population, and the population grows without anyone revisiting the allowlist. This is the failure that shows up in review as *we restricted it to the office range* on a range that includes several hundred laptops. ## Say what it is, then add what is missing | The check establishes | The check does not establish | | --- | --- | | The packet carried an allowed value | That the sender holds any secret | | Casual traffic is filtered out | That the payload was not altered | | Exposure is narrowed | Who issued the command | The honest replacement, when the service cannot move to an authenticated transport, is a per-message authenticator: a keyed code computed over the message body with a nonce or timestamp so replays are rejected, using a key each legitimate caller holds and the header does not carry. Where the transport can be changed, a mutually authenticated one gives the same property plus confidentiality and ordering. In either case the allowlist stays — as an outer filter that shrinks exposure and keeps noise off the service — but it stops being the thing that decides who may issue a command. ## How to answer this in an interview The strongest version of the answer does three things: it identifies the field as attacker-supplied input; it explains why the connectionless case removes even the accidental protection a handshake would have provided; and it re-labels the control rather than simply condemning it. Engineers who only say *IP allowlists are bad* tend to lose the argument with the team that built the service, because the allowlist really is doing something useful. Engineers who say *this is exposure reduction, and here is what we still need for authentication* tend to get the change made.

  • Is the same allowlist worth more in front of a TCP service?
    Somewhat. The handshake forces the peer to receive the server's answer, so an off-path forger cannot get through. But that proves only that the peer sits where traffic for the allowed address goes, which an on-path attacker or any compromised host inside the range also satisfies. It raises cost; it is still not identity, and it carries no message integrity.
  • What would you put in front of a UDP service that cannot be moved to an authenticated transport?
    A per-message authenticator the sender must compute: a keyed code over the payload plus a nonce or timestamp so old messages cannot be replayed, with a key each caller holds. Keep the allowlist as an outer filter to shrink exposure, but stop treating it as the decision about who may issue commands.
  • Why does a shared egress address make the allowlist weaker than it looks?
    Because the entry vouches for everything behind that address rather than for one system. A translation gateway or proxy egress can front hundreds of hosts, so the control's real subject is a population that grows over time without anyone revisiting the list.

saying these in an interview costs you the question

  • Calls a source-IP allowlist an authentication control
  • Believes UDP forgery requires an on-path position
  • Thinks internal-only means unreachable from outside
  • Assumes the attacker must receive the reply for the command to work

context