MB-R092
Payment webhook endpoints include signature validation, timestamp/replay protection, and idempotency evidence.
Payment webhook endpoints often update order state, captures, refunds, or fraud decisions. If they accept unsigned or weakly authenticated requests, attackers may spoof gateway events or replay old messages.
Strong webhook authentication proves the request came from the provider and was not modified in transit.
grep -RIE "webhook|callback|signature|hmac" app/code 2>/dev/null
# Confirm signature and timestamp validation happen before processing
curl -X POST https://mystore.com/payment/webhook -d "{}"
# Expected: 401/403 or provider-specific rejection
public function execute() {
$this->updateOrder($this->request->getContent());
}
# Processes callback without authentication → FAIL
if (!$this->signatureValidator->isValid($payload, $headers)) {
return $this->reject();
}
# Signature checked first → PASS