Application-level DoS on image's "size" parameter.
The image size parameter could be given very long values, causing the application to work very slowly; repeated requests could degrade availability.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 4 months
- Disclosed after 4 months
Summary
The size parameter located on images is vulnerable to DoS. By modifying the parameter's value an attacker can cause the application to work very slowly.
Description
The issue is located in the get_image_url() function in gratipay/models/team/__init__.py and can be exploited by replacing the small or large values in the following GET request: http://<GRATIPAY INSTANCE>/<USER>/image?size=small.
# Images
# ======
IMAGE_SIZES = ('original', 'large', 'small')
def get_image_url(self, size):
assert size in ('original', 'large', 'small'), size
return '/{}/image?size={}'.format(self.slug, size)
How can this issue be exploited?
Repeatedly sending values of 4094 characters in length will cause the DoS.
import requests
payload = "a" * 4094
url = "http://<GRATIPAY INSTANCE>/<USER>/image?size=small" + payload
for i in range(10000000):
requests.get(url)
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the assertion checking the size parameter was not enforced in production (assertions disabled) or the parameter was not validated before use, allowing arbitrarily long values to reach processing logic.
What the attacker needed
Access to the image endpoint; ability to send many requests
How it was found
- Identify the image endpoint that accepts a size parameter.
- Replace the size value with a very long string of characters.
- Send the request repeatedly to cause slow responses.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A web application lets users request images by adding a size value to the address. Sending very long size values made the server respond slowly, a denial of service.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.