botman / botman/driver-amazon-alexa

Driver does not verify Alexa request

Open
#11 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
15
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Not sure how active this repo is. I'd love to be able to work with someone to get this fixed and may even PR it if I can.

I've been building an Alexa skill with Botman and this driver.

The skill is failing Amazon's automated tests because it wasn't checking the request signature.

To publish a Skill it looks like you have to:

* check that the request is properly from Alexa (https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#verify-request-sent-by-alexa)
* verify the timestamp is valid (https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html#check-request-timestamp)
* verify that the request was for your skill (https://developer.amazon.com/docs/custom-skills/handle-requests-sent-by-alexa.html)

I've had a quick look through the source for this driver and I can't see any code that does any of this.

Can I ask:

1) Does anyone think that the driver should be doing this? Am I just missing something? Or is the code missing something?
2) If the code is missing something, can someone suggest where I should add these checks? I'm thinking it probably goes in `AmazonAlexaDriver->matchesRequest()` does that seem right? Or does BotMan have some other place I should put this kind of "middleware" check?

Thanks for any help.

Contributor guide

Open the contributing guide

Research direction

Start by reading the AmazonAlexaDriver->matchesRequest() entry point and the linked Alexa documentation for request signature, timestamp, and skill checks. Determine how these checks fit the driver's request flow; done means Alexa-origin validation, timestamp validation, and skill-target validation are covered and the automated publishing checks no longer fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.