After a server certificate change, a banking app's pin-failure reports spike; how do you tell your own mistake from interception, and what should the app do?
answer
- slice by version, network and key
- report to a host outside the pins
- silence is not proof
- refuse, explain, never continue
- a relax switch is a target
basics
~20 sSlice reports by app version, network and presented key: failures everywhere, in exactly the builds lacking the new key, are your rollout; an unknown key clustered on some networks is interception. Either way the app refuses and explains.
solid answer
~50 sEach pin-failure report should carry the app version, the pin set's identity, hashes of the keys the server presented, the network type and the time, and it must go to a reporting host outside the failing pin set, or wait in a queue. If failures start the minute the new certificate went live, on every network, in exactly the versions whose pin set lacks its key, and the presented key is the bank's own, the bank made a mistake: put the previous, still-pinned key back on the server. If the presented key is unknown and failures cluster on particular networks across all versions, it is interception, an attacker or an inspecting proxy, and the pin is doing its job. The app refuses without a continue-anyway button and tells the user what to try. A remote switch that relaxes pinning is tempting, but anyone who can forge that switch can turn pinning off.
code
json · 13 lines{
"event": "pin_failure",
"reportId": "5f0c2a9e-3c1b-4d7a-9f2e-8b1d6c4e7a10",
"appVersion": "7.42.0",
"pinSetId": "api-2026-03",
"pinSetExpired": false,
"host": "api.bank.example",
"presentedKeyHashes": ["b64:Qm9u...", "b64:SW50..."],
"networkType": "wifi",
"networkRegion": "GB",
"occurredAt": "2026-10-07T08:14:03Z",
"sentVia": "reports.bank-telemetry.example"
}go deeper
Recall that a pin failure means the server's key was not one the app expected, and that the app must refuse rather than let the user continue.
Explain what a pin-failure report carries and why it goes to a different host from the one that failed.
Separate a rollout mistake from interception by version, network and presented key, and fix your own mistakes on the server, the side you can roll back.
Decide whether a pinning relax switch should exist at all, and if so how it is signed, scoped and expired so it cannot become the attacker's tool.
## What a pin failure is A **pin failure** happens when the server's certificate passes normal checks but none of its public keys is in the app's compiled **pin set**. The app refuses the connection. Two very different causes produce the same symptom: the bank changed its key carelessly, or someone between the phone and the bank is presenting a different certificate. The response differs completely, so the first job is telling them apart. ## The report that makes triage possible Each failure should produce a small report: - the **app version** and the identity of the pin set it carries; - **hashes of the keys the server presented**, so the bank can see whether they are its own; - the **host**, the **network type** (Wi-Fi or cellular) and a coarse network identity; - the **time**, and whether the pin set had expired. Two delivery rules matter. The report must go to a **host outside the failing pin set**, or be queued until a working connection exists, because the failing connection cannot carry it. And **silence proves nothing**: an attacker who controls the network can drop reports too. The historical web standard for pinning had the same design, with reports sent to a separately configured address. ## Telling a mistake from interception | Signal | Your own rollout mistake | Interception | |---|---|---| | Start time | the minute the new certificate went live | unrelated to any change on your side | | Networks | every network, Wi-Fi and cellular alike | clustered: one Wi-Fi, one office range, one region | | App versions | exactly the versions whose pin set lacks the new key | all versions, including the newest | | Presented key | the bank's own new key | a key the bank has never issued | | Shape over time | steady until fixed | patchy, or a long low background | The same reports, collected before any rotation, give the **baseline**: the normal background rate of failures per network and per version. Without it, nobody can say whether today's number is a spike, and the first incident becomes the time the bank learns what normal looks like. A steady low background of failures with unknown keys from office networks is often **inspecting proxies**. They are legitimate to the employer, but cryptographically indistinguishable from an attacker, and the app treats them the same way. ## What the app does in either case 1. **Refuse.** A pin failure is not a warning; the historical web standard for pinning treated a pin failure as a non-recoverable error, and a banking app should behave the same: no override for the user. 2. **Explain.** Show a specific screen: "a secure connection to the bank could not be verified on this network", with suggestions to try mobile data and to update the app. 3. **Offer a way out** that does not depend on the failing host: the store listing for an update, a support phone number compiled into the app. 4. **Report**, as above. ## Fixing a mistake The server is the side the bank can roll back; the installed builds are not. The fastest fix for a botched rotation is to **put the previous, still-pinned key back on the API**, then plan the rotation properly. Shipping an update and waiting leaves the old builds locked out for weeks. ## The switch that relaxes pinning Teams under pressure want a remote switch that turns pinning off. If one exists, it is an attack surface: whoever can serve or forge that configuration can disable pinning for the very interception it was meant to stop. A defensible version: - is verified independently of the TLS connection it relaxes, for example signed with a key compiled into the app; - is scoped to specific app versions and expires on its own; - falls back to normal certificate checks, never to accepting anything. A common choice is not to have the switch at all, relying on backup keys, an expiry on the pin set and the server rollback instead. How remote switches are built in general is a separate subject; the point here is that this one disables a security control. ## What the interviewer is checking Whether the candidate designed the telemetry before the incident, knows which side can be rolled back, and refuses to buy convenience by adding a way for an attacker to switch the protection off.
- No pin-failure reports arrived from one country during an incident there. Can you conclude nobody was intercepted?No. An attacker who controls the network can block the reporting host as easily as the API. Absence of reports is weak evidence; compare it with traffic volume from that region, since a sudden drop in successful sessions with no reports is itself a signal.
- Support wants a hidden 'continue anyway' option for customers stuck on hotel Wi-Fi. What do you say?No. Some of those networks may be the attack the pin exists to stop, and the customer cannot tell which. Offer mobile data, a clear explanation and a support number instead; the protection is only worth having if it cannot be clicked past.
- A pin failure always means an attacker is on the user's network.
- Let the user tap continue anyway when the pin check fails.
- No pin-failure reports means nobody is intercepting the app.
- Send pin-failure reports to the same API host that just failed.
- Fix a botched key rotation by shipping an update and waiting.