graphql / graphql/graphiql

clickjacking vulnerability

Open
#683 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

Hi there,

I found that a clickjacking attack can be performed in graphiql.

Whiling visiting graphiql, the value of parameter "*query*" would be placed in editor, so when user click the "*execute button*", a GraphQL query will be sent to server and executed.

If attackers trick a logined user into clicking this button, malicious query (such as a mutation) will be executed.

For example, I set up 2 pages:

1. https://graphqlapp.herokuapp.com/?query=%7B%0A%20%20profile%20%7B%0A%20%20%20%20name%0A%20%20%20%20age%0A%20%20%7D%0A%7D%0A
2. http://675ba661.w1n.pw/f8d888

page 1 is the GraphiQL(using express-graphql), page 2 was created by attackers.

Open the page 1, you can see that your name is Bob at this time. After click the "*click*" button on page 2, your name will be changed to "*your name has been modified*" whithout your permission.

I recorded a screenshot for it:

![2018-06-04_03-59-14](https://user-images.githubusercontent.com/5711185/40880406-b2e26d4c-66e2-11e8-947c-cc5e6aaa7d82.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.