Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
|
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. Top GraphQL Security Vulnerabilities: Lessons Learned Analyzing 1,500+ Endpoints
Engineering
January 29, 2024
4 min read

Top GraphQL Security Vulnerabilities: Lessons Learned Analyzing 1,500+ Endpoints

Kong
Youtube thumbnail

With its flexible querying capabilities, GraphQL makes it easy to combine data from multiple sources into a single endpoint. GraphQL and API management go hand in hand to build next-generation API platforms. 

However, GraphQL's features can also introduce security risks if not properly implemented.

In a talk at API Summit 2023, Tristan Kalos and Antoine Carossio (co-founders of GraphQL security testing company Escape) dug into the most common and most underestimated vulnerabilities unearthed by analyzing over 130,000 public GraphQL endpoints. In their research, which is gathered in The State of GraphQL Security 2023 report, they identified nearly 50,000 security alerts, 10% of which were critical.

So, how can GraphQL be prone to security issues? And what are the most common vulnerabilities developers need to watch out for? Let's break it down.

Why is GraphQL vulnerable?

GraphQL is vulnerable for two key reasons:

1. It’s powerful features open security gaps

The features in GraphQL that give it flexibility can also be exploited by attackers. For example, GraphQL allows batching and aliasing requests. This lets you send multiple queries in one HTTP request.

This is great for performance. But it also lets attackers bypass rate limiting enforced at the HTTP layer — meaning they can send hundreds of login attempts in one request to brute force credentials.

Another example worth calling out is GraphQL's recursive fragments. These allow developers to reuse query logic. But an unprotected GraphQL engine can be crashed with infinite recursion, creating a denial of service vulnerability.

2. It’s graph structure obscures access control

In GraphQL, every entity can be accessed via multiple paths. This makes it easy for developers to inadvertently expose access to sensitive data.

For instance, an admin mutation could be left unprotected under the assumption it's not publicly accessible. But if another path leads to it, an attacker could discover and abuse it.

Robust access control in GraphQL requires meticulous auditing of all possible paths — which is not exactly a trivial task.

The most common GraphQL vulnerabilities

Across over 1,600 scanned production apps, the team at Escape found both GraphQL-specific vulnerabilities along with plenty of classic API vulnerabilities. The most common GraphQL vulnerabilities they encountere include:

1. Brute forcing API requests

The aforementioned batching and aliasing features enable brute-forcing attacks even past rate limits. Expect account takeovers if login mechanisms aren't robust.

2. Denial of service

Unprotected recursive fragments create crashes. GraphQL's flexibility naturally risks resource exhaustion DoS attacks.

3. Internal API schema leak

Many GraphQL servers try to hide their schema, but the field suggestion feature can inadvertently leak it. Public tools like Clarivoyance automate schema reconstruction. This exposes private mutations. In one case, Escape took over an admin account by finding an unprotected password reset mutation.

API security vulnerabilities

Beyond the GraphQL-specific vulnerabilities, Escape also uncovered some classic API security vulnerabilities in their research that can’t be overlooked. Not surprisingly, there was much overlap between the vulnerabilities found and the OWASP API Security Top 10. 

API errors and stack traces disclosing internal data

The problem here is that Stack Traces give too much information on what’s vulnerable in your app. 

For example, when there’s a GraphQL error, it gives the precise path of the source code that created the problem. Using this, one could get information about the libraries used by this GraphQL endpoint — and then look up vulnerabilities that affect these libraries.

Access control issues

This is very common in GraphQL. Most routes writing data (mutation) aren’t supposed to be accessible without authentication. However, many GraphQL endpoints have bad access control implementation and thus an unauthorized user or a user with low-level authorization can access restricted data. 

Injection vulnerabilities

Believe it or not, injection attacks are still a major issue. Escape’s research uncovered SQL, NoSQL, and even Bash command injections in GraphQL services. This can lead to data theft if developers don't follow secure coding practices.

Other classic API flaws

GraphQL isn't immune to traditional security pitfalls. 40% of the discovered vulnerabilities were classic API issues, like broken authentication and access control. Notably, improper error handling exposed internal API keys and secrets. GraphQL doesn't inherently protect downstream dependencies.

Massive amounts of sensitive data exposed

Most alarmingly, Escape’s analysis discovered huge amounts of sensitive data leaked in public GraphQL endpoints, including:

  • Personal identifiable information like emails, phone numbers, and passport details
  • Private API keys and tokens for AWS, GCP, GitHub, Slack, etc.
  • Hashed and even cleartext passwords

This data exposure could enable account takeovers, cloud resource hijacking, and identity theft. It highlights the pressing need for rigorous security controls in GraphQL services.

Conclusion

GraphQL opens new horizons for API development. With disciplined security practices, you can build the next generation of interfaces while keeping your data safe.

For this and other talks around all things related to APIs, check out on-demand sessions from API Summit.

API SecurityAPI AuthenticationAPI Authorization

More on this topic

Videos

Federated Data Authorization using Semantic Policies

Videos

Okta and Kong: Integrate Identity into your APIs

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo
Topics
API SecurityAPI AuthenticationAPI Authorization
Share on Social
Kong

Recommended posts

How to Implement Secure Access Control with OPA and Kong Gateway

Kong Logo
EngineeringJanuary 8, 2025

Ensuring secure access to applications and APIs is critical. As organizations increasingly adopt microservices architectures and cloud native solutions, the need for robust, fine-grained access control mechanisms becomes paramount. This is where the

Raja Ravi Varman

Adopt a Zero Trust Approach with OAuth 2.0 Mutual TLS Client Authentication

Kong Logo
EngineeringFebruary 19, 2024

In the modern IT stack, API gateways act as the first line of defense against attacks on backend services by enforcing authentication/authorization policies and validating and transforming requests. When backend services are protected with a token-b

Samuele Illuminati

Understanding Microsegmentation in Zero Trust Security

Kong Logo
EngineeringFebruary 6, 2024

With digital transformation shifting networks into the cloud — from remote workforces to online banking — cyberattacks are growing more prevalent and sophisticated. Legacy security models like VPNs and perimeter-based firewalls are proving inadequat

Kong

Token-Based Access Control With Kong, OPA and Curity

Kong Logo
EngineeringOctober 6, 2021

As APIs and microservices evolve, the architecture used to secure these resources must also mature. Utilizing a token-based architecture to protect APIs is a robust, secure and scalable approach, and it is also much safer than API keys or basic au

Jonas Iggbom

Solving API Authorization Challenges in Multi-Cloud Environments

Kong Logo
EngineeringSeptember 9, 2021

As more and more companies move to a multi-cloud strategy and increase usage of a cloud native infrastructure , API providers are under a lot of pressure to deliver APIs at scale in multi-cloud environments. At the same time, APIs should follow eac

Nima Moghadam

Setting Access Control Policies With Kong and Okta

Kong Logo
EngineeringJune 24, 2021

In our last Kong and Okta tutorial, we will implement a basic access control policy based on Okta’s groups and planes. This series will show you how to implement service authentication and authorization for Kong Konnect and Okta using the OpenI

Claudio Acquaviva

Protect Your Services With Kong Gateway Key Authentication

Kong Logo
EngineeringMay 25, 2021

This tutorial will walk through a common use case for the Kong Gateway Key Authentication plugin : using API key authentication to protect a route to an API server endpoint. It’s a simple use case, but it will give you the foundation to deploy and

Aapo Talvensaari

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

    • Platform
    • Kong Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2026