Your verifier keys each result by a value the credential carries. Feed it two entries with the same key and the second overwrites the first. Guess which one the attacker wants to land last.
What goes wrong
You verify a credential that carries a list of status entries. Each entry gets checked, and you file the outcome under a key. The catch: the key comes from the credential itself, so the caller decides it. When two entries share a key, your map keeps the one that landed last.
That is enough to hide a bad result. An attacker adds a second entry whose key matches the first, but whose outcome is clean. The revoked or suspended result gets checked, recorded, then quietly replaced. Downstream code reads the map, sees a passing status, and lets the request through.
The map never lied. It did exactly what a last-write-wins merge does. The mistake was treating caller-supplied data as a trusted key and letting a later write clobber a security decision that had already been made.
The pattern
results = {}
for entry in credential.statusEntries:
key = entry.purpose # attacker controls this
outcome = checkStatus(entry)
results[key] = outcome # last write silently wins
return results[key] # trusted downstreamresults = {}
for entry in credential.statusEntries:
key = entry.purpose
outcome = checkStatus(entry)
if key in results:
outcome = worst(results[key], outcome) # never soften
results[key] = outcome
assertNoDuplicateKeys(credential) # or reject up front
return results[key]Every gate held. The exploit path was reproduced against a negative control, the impact was calibrated, and the finding was signed report-ready.
Why it matters to you
Any system that merges results into a keyed collection can hit this, whether you are checking credential status or per-scope permissions. If the key is attacker-reachable and a later value can overwrite an earlier one, a negative result is one duplicate away from vanishing.
The fix costs almost nothing. Decide up front whether duplicates are even legal, and if they are, fold them so the safest answer survives instead of the newest one.
Check your own code
- Find every map whose key comes from request or document data
- Check whether a second write can overwrite a security result
- Make merges fail closed: keep the worst outcome, not the latest
- Reject duplicate keys where the schema does not allow them