A caller hands your state machine a transfer-succeeded report. Your code believes it, flips the verified flag, and fires the done callback. No transfer required.
What goes wrong
The API takes any message a caller passes and routes it by type. One of those types is a status report saying a transfer went through. When the handler sees that report, it marks the exchange verified and calls the completion hook. It never checks what state the protocol was actually in, or whether a transfer was even in progress.
So a caller skips the work and sends the receipt. The handler treats an unsolicited report exactly like a real one produced at the end of a genuine exchange. There is also no binding to the peer that should have produced it, so a report from the wrong source counts just the same.
State machines get this wrong when the transition is driven by the message type instead of the current state. 'I received a success message' and 'the operation succeeded' are different claims. Only the second one should flip a verified flag.
The pattern
function handle(msg) {
switch (msg.type) {
case SUCCESS_REPORT:
transferVerified = true
onResponseSent() // fired regardless of state
break
}
}function handle(msg) {
if (msg.type != SUCCESS_REPORT) return
if (state != AWAITING_REPORT) { drop(msg); return }
if (msg.sender != boundPeer) { drop(msg); return }
if (msg.transferId != activeTransfer) { drop(msg); return }
transferVerified = true
state = DONE
onResponseSent()
}Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.
Why it matters to you
A verified flag usually gates something real, like a payment marked settled or a session marked trusted. If an attacker can set that flag by sending a message, the guarantee behind it is gone. Any public entry point that mutates protocol state needs to check the current state before it acts, instead of trusting the shape of the input.
Check your own code
- List every message type that can change a security-relevant flag and confirm each checks current state first.
- Reject status reports that arrive outside the window where they are expected.
- Bind acknowledgements to the specific peer and transfer they claim to describe.
- Make sure a public API cannot inject internal protocol messages from outside.