Idor resulting to image deletion in https://support.mozilla.org/
The image deletion handler in the questions view did not check whether the requesting user owned the image before deleting it. An attacker could supply any image identifier and delete images belonging to other users.
Originally disclosed on Mozilla
- Fixed in 11 days
- Paid in 17 days
- Disclosed after 11 days
Hi. The source code of the platform powering sumo is available in github, https://github.com/mozilla/kitsune. While auditing the code, i found a potential idor that allows any user to potentially delete all the images in the site.
In the function reply, in questions/views.py, if we provided a post parameter delete_images, and if we provide an id of a image in delete_image post parameter, the image with the specified id will be deleted without permission checks.
The line of code is
'''
if "delete_images" in request.POST:
for image_id in request.POST.getlist("delete_image"):
ImageAttachment.objects.get(pk=image_id).delete()
'''
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
The delete handler looked up an image by the supplied primary key and deleted it without verifying that the current user owned or was permitted to delete that image.
Impact
Any user could potentially delete all images on the site, including images belonging to other users.
What the attacker needed
Access to the platform; ability to submit a post with image ids
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.
An IDOR (insecure direct object reference) happens when a website accepts an identifier for a thing, such as an image number, and acts on it without checking that the person asking is allowed to touch that thing. Here the code deleted whatever image number was sent, so anyone could remove other people's images.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.