<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq" -->

---
title: GHSA-wqwf-8p4q-mwqj (graphql): Exponential time when...
description: A small, valid GraphQL query can make graphql-ruby's complexity analyzer run in exponential time when max_complexity is set. The excessive work happens outside...
canonical: https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GHSA-wqwf-8p4q-mwqj (graphql): Exponential time when calculating complexity | daily.dev
og:description: A small, valid GraphQL query can make graphql-ruby's complexity analyzer run in exponential time when max_complexity is set. The excessive work happens outside...
og:url: https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq
og:image: https://api.daily.dev/og/posts/mM1vzhKtq.png
og:image:alt: GHSA-wqwf-8p4q-mwqj (graphql): Exponential time when calculating complexity
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GHSA-wqwf-8p4q-mwqj (graphql): Exponential time when calculating complexity

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 1 min read · 0 upvotes · 0 comments

## Summary

A small, valid GraphQL query can make graphql-ruby's complexity analyzer run in exponential time when max_complexity is set. The excessive work happens outside validate_timeout, so the query is not rejected. max_depth also does not prevent the issue. Versions below 2.3.0 are unaffected, and the fix lands in 2.6.16 and later.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://rubysec.com/advisories/GHSA-wqwf-8p4q-mwqj>

## Questions this post answers

### Is there a known vulnerability in the graphql-ruby gem's complexity checking?

Yes, a crafted but valid query can cause the complexity analyzer to run in exponential time when max_complexity is configured. This work occurs outside validate_timeout, so the query isn't rejected, and max_depth doesn't prevent it either. Versions before 2.3.0 are unaffected; the fix is patched in graphql-ruby 2.6.16 and later, tracked as GHSA-wqwf-8p4q-mwqj.

_Teams hardening GraphQL APIs against denial-of-service queries can track gem advisories like this on daily.dev._

### What graphql-ruby version fixes the exponential complexity calculation bug?

The fix is available in graphql-ruby 2.6.16 and later. Versions prior to 2.3.0 were not affected by this issue, which allowed a small, valid query to make the complexity analyzer take exponential time, bypassing both max_complexity rejection and max_depth limits.

_Developers patching dependency vulnerabilities can follow gem advisories like this one on daily.dev._

## Similar posts on daily.dev

- [GHSA-5f8h-c2xc-j37j \(graphql\): Crafted query strings can cause exponential backtracking in the Ruby lexer on older Rubies](https://daily.dev/posts/ghsa-5f8h-c2xc-j37j-graphql-crafted-query-strings-can-cause-exponential-backtracking-in-the-ruby--oojm3lvdr) · RUBYLAND · 0 upvotes · 0 comments
- [GHSA-4rw8-495r-pf6j \(graphql\): Execution::Next renders objects whose authorized? check failed](https://daily.dev/posts/ghsa-4rw8-495r-pf6j-graphql-execution-next-renders-objects-whose-authorized-check-failed-0j2vrvyxg) · RUBYLAND · 0 upvotes · 0 comments
- [Shopify Reports 15X Faster Graphql Execution with Breadth First Engine](https://daily.dev/posts/shopify-reports-15x-faster-graphql-execution-with-breadth-first-engine-0xn3kh03q) · InfoQ · 1 upvotes · 0 comments
- [GHSA-492h-6x29-69mq \(graphql\): Authorization - \`.authorized?\` skipped after crafted connection cursors](https://daily.dev/posts/ghsa-492h-6x29-69mq-graphql-authorization---authorized-skipped-after-crafted-connection-curso-9pphpjdj5) · RUBYLAND · 0 upvotes · 0 comments
- [Ruby Weekly Issue 779: December 11, 2025](https://daily.dev/posts/ruby-weekly-issue-779-december-11-2025-epempsdkp) · Ruby Weekly · 2 upvotes · 0 comments

---

Tags: [#cyber](https://daily.dev/tags/cyber), [#ruby](https://daily.dev/tags/ruby), [#graphql](https://daily.dev/tags/graphql)

[View this post on daily.dev](https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"GHSA-wqwf-8p4q-mwqj (graphql): Exponential time when calculating complexity","url":"https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq"},"datePublished":"2026-11-21T16:22:22.857Z","dateModified":"2026-11-21T16:22:42.526Z","description":"A small, valid GraphQL query can make graphql-ruby's complexity analyzer run in exponential time when max_complexity is set. The excessive work happens outside...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5fa7bf38a8a9c178c1d458f9f735556c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5fa7bf38a8a9c178c1d458f9f735556c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cyber,ruby,graphql","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"GHSA-wqwf-8p4q-mwqj (graphql): Exponential time when calculating complexity"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ghsa-wqwf-8p4q-mwqj-graphql-exponential-time-when-calculating-complexity-mm1vzhktq#faq","mainEntity":[{"@type":"Question","name":"Is there a known vulnerability in the graphql-ruby gem's complexity checking?","acceptedAnswer":{"@type":"Answer","text":"Yes, a crafted but valid query can cause the complexity analyzer to run in exponential time when max_complexity is configured. This work occurs outside validate_timeout, so the query isn't rejected, and max_depth doesn't prevent it either. Versions before 2.3.0 are unaffected; the fix is patched in graphql-ruby 2.6.16 and later, tracked as GHSA-wqwf-8p4q-mwqj. Teams hardening GraphQL APIs against denial-of-service queries can track gem advisories like this on daily.dev."}},{"@type":"Question","name":"What graphql-ruby version fixes the exponential complexity calculation bug?","acceptedAnswer":{"@type":"Answer","text":"The fix is available in graphql-ruby 2.6.16 and later. Versions prior to 2.3.0 were not affected by this issue, which allowed a small, valid query to make the complexity analyzer take exponential time, bypassing both max_complexity rejection and max_depth limits. Developers patching dependency vulnerabilities can follow gem advisories like this one on daily.dev."}}]}
```

