Skip to content

Commit

Permalink
fix: Fast fail invalid SNS notification. Fixes: #1182 (#1185)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Apr 22, 2021
1 parent cff9e33 commit 79cae5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eventsources/sources/awssns/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ func (router *Router) HandleRoute(writer http.ResponseWriter, request *http.Requ
return
}

if notification == nil {
common.SendErrorResponse(writer, "bad request, not a valid SNS notification")
return
}

// SNS Signature Verification
if router.eventSource.ValidateSignature {
err = notification.verify()
Expand Down

0 comments on commit 79cae5c

Please sign in to comment.