A licence check with five separate validations still falls to one patch if all five live in
the binary. That is the pattern in every case I publish: the checks were not weak, they were
local. Fix the shape of the answer, then the number of checks stops mattering.
DO THIS
- Never ship a secret that can authorise anything. An API key, a master credential or
a signing key inside the app is public the moment the app is public. Recovery tooling reads
embedded strings before it reads your logic. Server-held secrets only.
- Sign the payload, not the status. HMAC or Ed25519 over the actual content plus
account, expiry and nonce. Verify on the client before use, and verify on the server before
serving. A tampered "success" byte then buys the attacker nothing.
- Use asymmetric keys so the client can only verify. A symmetric key in the binary can
be used to forge responses as well as check them, which is worse than no signature.
- Put a clock on every response. A freshness window of a minute or two, plus a
monotonic nonce, kills replay. Without it, one captured valid response is a permanent
licence.
- Sign the feature block as a unit. If features are a list the client reads, the list
must be inside the signature. Per-flag checks that each read an unsigned field give an
attacker a checklist to walk.
- Rotate and revoke. Version your signing keys so a leaked one can be retired without
breaking every install, and keep a revocation list the server consults.
The test that catches most of this: capture one successful validation response, replay
it a week later on a different machine with the clock rolled back. If the app still works,
freshness and binding are both missing.
WHAT THIS COSTS YOU
- A key pair, a version field, and a nonce column. Small.
- Clock-skew handling in support. Somebody's laptop is always wrong.