-
-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Authorizer and AWS deployed stack don't have the same behavior #1259
Comments
@dherault We reserved the CVE-2021-38384 with Mitre to this vulnerability, but we also would like to submit it via Github, and also make a pull request to help solve this issue |
Wondering if there is an update for this...Is this vulnerability considered acceptable by project authors, or is there a fix in development? |
Is this issue fixed in any versions of 8.x.x |
@dherault which commit addresses this issue? |
It'd be nice if you were to at least recreate the defect with some tests, then it'd help both the resolution of the reported defect and prevent regression.
According to https://security.snyk.io/vuln/SNYK-JS-SERVERLESSOFFLINE-1540299 they claim Going to repro it locally and check which version is it fixed in. |
Bug Report
Current Behavior
When using a Custom Authorizer, the behaviour of serverless-offline differs from the deployed stack on AWS.
Sample Code
This is where we define the function event trigger. As it's clear to see, we expect a HTTP POST on
/{stage}/dashboard/
Our custom authorizer generatePolicy method looks like this.
We're basically generating the following policy to someone with the role "USER":
Expected behavior/code
When testing locally using serverless-offline, fetching the endpoint http://localhost:3000/dev/dashboard/, the response is 403 Forbidden as the screenshot shows.
But when we deploy the stack to AWS, fetching the endpoint https://RANDOM.execute-api.us-east-1.amazonaws.com/dev/dashboard/, the result is 200 ok as its seen here.
Environment
serverless
version: v2.53.0serverless-offline
version: v8.0.0node.js
version: v12.21.0OS
: Linux Mint 19.1 TessaAdditional context/Screenshots
We found this issue while doing the research The Fault in Our Stars, in which we explore how API Gateway Execute API Policy works under different conditions.
One researcher from our company opened the issue 1191 where he indicates another incorrectly behaviour by serverless-offline regarding the way it evaluates policies. It still lacks a response to this date.
The text was updated successfully, but these errors were encountered: