High

GraphQL-core has denial of service via memory leak in aborted validations

  • Disclosed: 30.10.2026
  • Updated: 08.11.2026 10:00

Summary

When a validation was aborted because the document contained more errors than allowed by max_errors (100 by default), validate() raised a single module-level ValidationAbortedError instance. Python appends the frames of every raise to the existing __traceback__ of an exception that is raised again, so every aborted validation extended the traceback of this shared error. That traceback kept the frames, and with them the document, the validation context and all errors of every aborted validation, alive for the lifetime of the process.

Details

Any client can trigger an aborted validation by sending a small document with more than 100 validation errors, e.g. 101 unknown fields. No authentication is required, and since validation runs before execution, depth limiters and complexity analyzers do not prevent it. Each such request permanently retained about 124 KiB on CPython 3.12, without an upper limit, so memory grew with every request until the process was restarted or killed.

GraphQL.js uses a shared error object at the same place, but JavaScript errors capture their stack trace only once when they are created, so it is not affected. GraphQL-core 3.2 creates a new error for each aborted validation and is not affected either.

Proof of concept

python
import gc
import tracemalloc
from graphql import build_schema, parse, validate

schema = build_schema("type Query { a: Int }")
document = parse("{ " + " ".join(f"f{i}" for i in range(101)) + " }")

tracemalloc.start()
validate(schema, document)
gc.collect()
base = tracemalloc.get_traced_memory()[0]
for _ in range(200):
    validate(schema, document)
gc.collect()
print((tracemalloc.get_traced_memory()[0] - base) // 1024, "KiB")

With GraphQL-core 3.3.0 on CPython 3.12, the retained memory grows from 147 KiB after one call to about 25 MB after 200 calls. With the fix, it stays constant at about 180 KiB.

Impact

Denial of service through memory exhaustion. A few thousand small requests are enough to push a worker past a typical 256 MB or 512 MB container limit and trigger an OOM kill. No data is disclosed or modified.

Patches

Fixed in 3.3.1.

validate() now creates a new ValidationAbortedError for every aborted validation and removes its traceback and exception context before returning it, so that the returned errors do not keep the frames of the validation alive. The module-level validation_aborted_error instance, which was not exported, has been removed.

Workarounds

If you cannot upgrade, clear the traceback of the shared error after each validation:

python
from graphql.validation import validate as validate_document
from graphql.validation.validate import validation_aborted_error

def validate(*args, **kwargs):
    try:
        return validate_document(*args, **kwargs)
    finally:
        validation_aborted_error.__traceback__ = None

Pass this function instead of the original validate where your framework allows it.

Credits

Reported by @riodw. @Fire162 submitted a first fix in #288.

What to do

Upgrade to version 3.3.1 or apply the workaround to clear tracebacks.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) graphql-core >= 3.3.0a3, < 3.3.1 3.3.1

References

CVSS score 7.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness (CWE)
CWE-400, CWE-401
Platform
Python (PyPI)
Package
graphql-core
Disclosed
30.10.2026
Updated
08.11.2026 10:00

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-mpqx-q82w-9x46 - CC BY 4.0

Vulnerability history: graphql-core

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
10.2026 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 3

Disclosures per year

  1. 2026: 3
  1. GraphQL-core has denial of service via memory leak in aborted validations this entry
    High · 7.5 CVE-2026-119286 >= 3.3.0a3, < 3.3.1 3.3.1
  2. High · 7.5 CVE-2026-75508 >= 3.2.3, < 3.2.12, >= 3.3.0a3, < 3.3.0rc1 3.2.12, 3.3.0rc1
  3. High · 7.5 CVE-2026-75507 >= 3.0.0, < 3.2.12, >= 3.3.0a1, < 3.3.0rc1 3.2.12, 3.3.0rc1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.