Summary
The HMAC signature covers "{timestamp}.{body}", but the X-StellarGate-Event header is sent separately and is not part of the signed material.
Location
src/webhook.rs:33-40 (signs timestamp + body only)
src/webhook.rs:118 / src/api/payments.rs:427 (send unsigned X-StellarGate-Event)
Details & impact
Receivers that route or make decisions based on the (convenient) header rather than the signed body event field can be misled — the header can be altered on-path without invalidating the signature, and on redelivery it is even hard-coded to payment.completed (see related issue).
Suggested fix
Document that only the body is authenticated (route on the signed event field), or include the event in the signed material.
Acceptance criteria
- Event routing relies only on signed data, and docs say so explicitly.
Summary
The HMAC signature covers
"{timestamp}.{body}", but theX-StellarGate-Eventheader is sent separately and is not part of the signed material.Location
src/webhook.rs:33-40(signs timestamp + body only)src/webhook.rs:118/src/api/payments.rs:427(send unsignedX-StellarGate-Event)Details & impact
Receivers that route or make decisions based on the (convenient) header rather than the signed body
eventfield can be misled — the header can be altered on-path without invalidating the signature, and on redelivery it is even hard-coded topayment.completed(see related issue).Suggested fix
Document that only the body is authenticated (route on the signed
eventfield), or include the event in the signed material.Acceptance criteria