Skip to content
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

Change action to POST in readme #53

Closed
wants to merge 1 commit into from
Closed

Change action to POST in readme #53

wants to merge 1 commit into from

Conversation

lalithr95
Copy link

No description provided.

@dylanahsmith
Copy link
Contributor

Why? This makes it inconsistent with the example/config.ru and the integration tests.

@lalithr95
Copy link
Author

I didn't check the files, GET makes vulnerable to login csrf ? If this makes sense I'll push file changes.

@dylanahsmith
Copy link
Contributor

This login form is only the start of the oauth process. It won't actually log the user into Shopify or install the app in the Shopify store. I'm not sure what action you are worried about being forged.

Besides, changing the form isn't going to prevent any vulnerability, since it won't change the fact that the endpoint accepts GET requests.

This library doesn't even work with the change you are proposing, since that endpoint looks for the shop parameter in the GET parameters.

@EiNSTeiN-
Copy link
Contributor

This is a long story but here we go... The action that is vulnerable to csrf is the login action. If someone has already signed into an app at any moment in the past, they will go through the oauth flow on shopify's side without being prompted. This leads to the situation where if anyone visits the /auth/shopify?shop=... path on a app where they have already signed in, they will be signed in again.

For regular shopify apps, we would accept the get request but validate the signature provided by shopify before initiating the login (we don't do it currently). In some other cases where the app itself initiate the login to shopify (app store, theme store, EU, etc) we should validate the csrf token and use a POST request.

So far I have fixed the app store which is the only of our oauth apps to not be vulnerable to CSRF for the login action...

@lalithr95
Copy link
Author

To allow the functionality for regular apps which use get request, this change doesn't make sense. Fixing other shopify apps which are vulnerable to login CSRF would be the initial step before bringing this change ? I had a look at some of the app, only app store uses a POST request to login with shopify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants