Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GraphQL Server Security Best Practices

GraphQL Server Security Best Practices

Robert Saunders

September 18, 2019
Tweet

More Decks by Robert Saunders

Other Decks in Technology

Transcript

  1. Relay Global Object Identification Spec • Recommends that GraphQL schemas

    provide a standard way to fetch objects by globally-unique IDs. • Enables consistent object caching (on both the client and server) and re- fetching by popular GraphQL client- side libraries, via the node field.
  2. - Wikipedia “A denial-of-service attack is a cyber-attack in which

    the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host connected to the Internet.”
  3. GraphQL requests are hard to predict the cost of, thus

    setting constraints is a must. Takeaway 4
  4. - " “Side-channel attacks, as they relate to public APIs

    usually come down to attackers finding inventive ways to make revealing inferences about data they cannot directly obtain, due to an API’s otherwise well-functioning authorization layers. These attacks can provide attackers insights into your and your customers' businesses.”
  5. 1. Perform authentication outside of GraphQL layer. 2. Have authorization

    in the schema per type. 3. Scope operations down to what the authenticated viewer should actually be able to see. 4. GraphQL requests are hard to predict the cost of, thus setting constraints is a must. 5. Where possible, prevent giving clues to data that the user does not have access to. Recap: