Idor in Image Upload in support.mozilla.org
Categories
(support.mozilla.org :: General, defect)
Tracking
(Not tracked)
People
(Reporter: roldanbrandon62, Assigned: rjohnson)
References
()
Details
(Keywords: reporter-external, sec-low, wsec-objref, Whiteboard: [reporter-external] [web-bounty-form] [verif?])
Hi. While auditing the code of support.mozilla.org, i found this endpoint
re_path(
r"^/image/(?P<model_name>\w+\.\w+)/(?P<object_pk>\d+)$",
views.up_image_async,
name="upload.up_image_async",
),
This is the up_image_async function
def up_image_async(request, model_name, object_pk):
"""Upload all images in request.FILES."""
# Verify the model agaist our white-list
if model_name not in ALLOWED_MODELS:
message = _("Model not allowed.")
return HttpResponseBadRequest(json.dumps({"status": "error", "message": message}))
# Get the model
m = apps.get_model(*model_name.split("."))
# Then look up the object by pk
try:
obj = m.objects.get(pk=object_pk)
except ObjectDoesNotExist:
message = _("Object does not exist.")
return HttpResponseNotFound(json.dumps({"status": "error", "message": message}))
try:
file_info = upload_imageattachment(request, obj)
except FileTooLargeError as e:
return HttpResponseBadRequest(json.dumps({"status": "error", "message": e.args[0]}))
if hasattr(obj, "clear_cached_images"):
# if the object the image is attached to has a `clear_cached_images` method,
# like questions and answers do, call it
obj.clear_cached_images()
if isinstance(file_info, dict) and "thumbnail_url" in file_info:
return HttpResponse(json.dumps({"status": "success", "file": file_info}))
message = _("Invalid or no image received.")
return HttpResponseBadRequest(
json.dumps({"status": "error", "message": message, "errors": file_info})
)
Here, it get the object, with the model we provided, based on its pk in the object_pk argument. The model could be either of these three "questions.Question", "questions.Answer", "auth.User". and call the upload_imageattachment function on the target object.
Since one of the model is auth.User, we can change the image of other users. There are also models like questions.Question and questions.Answer but cant test it since the site is down
| Reporter | ||
Comment 1•4 years ago
|
||
I have tested it now and i am wrong in the auth.User object. I am not sure how it works, but the questions.Question and questions.Answer allows us to add an image on anyone's question or answer
Comment 2•4 years ago
|
||
Hello,
Thank you for your report.
The team are working on fixing the staging instance. It is still down for me.
I was reading the code when you sent the latest comment.
Do you mean that users can upload an attachment to another user already posted question? or can they upload attachment in a new reply?
Thanks,
Frida
| Reporter | ||
Comment 3•4 years ago
|
||
Hello, i mean users can upload an attachment on other users already posted question/answer
Comment 4•4 years ago
|
||
Can you please provide steps to reproduce? I can try this when the staging instance is fixed.
Thanks,
Frida
| Reporter | ||
Comment 5•4 years ago
|
||
Sure
STEPS TO REPRODUCE
- Have two accounts, we will call these two users as user a and user b
- As user , make a question
- As user b, go to https://support.mozilla.org/en-US/questions/new/ios/form
- Upload an image to simulate a image upload request, and intercept it
- The endpoint will look like /en-US/upload/image/auth.User/<USERID>, replace it with /en-US/upload/image/questions.Question/<QUESTIONID>, replace QUESTIONID with the id of the question from step 2.
- You will see that there is now an image attached to the question of user a
| Reporter | ||
Comment 6•4 years ago
|
||
The site seems to be up and running now, will try to reproduce it and also take a video poc about it in a moment
| Reporter | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Hello,
I was able to reproduce the issue using a POST request to /en-US/upload/image/questions.Question/<question_id> endpoint.
Thanks,
Frida
| Reporter | ||
Comment 9•4 years ago
|
||
Cool, thank you
Updated•4 years ago
|
| Reporter | ||
Comment 10•4 years ago
|
||
Hi. Any updates on this and all my other reports? It has been 20 days now. Thanks
Comment 11•4 years ago
|
||
The engineering team are working through the reported issues, we will update the bugs when we have more information.
Hello Tasos,
Can you please check this issue as well?
Thanks,
Frida
| Reporter | ||
Comment 12•4 years ago
|
||
Hi. The lack of action in this report is alarming. Any updates?
Comment 13•4 years ago
|
||
Hello Brandon,
I discussed the reports that are open with Tasos and he is addressing them based on priority and severity. We appreciate your patience so far.
Thanks,
Frida
| Comment hidden (admin-reviewed) |
Comment 15•4 years ago
|
||
Hello Brandon,
Please refer to my previous comment 13. The SUMO team are doing their best to address security issues, we receive reports from various sources and we prioritize the fixes based on severity.
Please refer to our participation guidelines regarding commenting on bugs, https://bugzilla.mozilla.org/page.cgi?id=etiquette.html.
Thanks,
Frida
| Reporter | ||
Comment 16•4 years ago
|
||
Hello, any updates? we are halfway through 4 months now. Also, can i disclose this bug? According to the faq page in https://www.mozilla.org/en-US/security/bug-bounty/faq-webapp/
Bug reporters may open the bug to public view earlier whenever circumstances warrant it (e.g., if you feel your bug report is being completely ignored). However, in the interests of protecting our users, we would appreciate a reasonable amount of time to address the issue before the information is publicly disclosed.
I think 3 months is a reasonable amount of time. At least, that is the average time it took companies to fix bugs.
Comment 17•4 years ago
|
||
we prefer to disclose bugs after they are fixed so that we protect our users. The bug is not ignored, we are tracking it internally and the team are addressing the security bugs based on their severity. Based on our policy, medium severity issues have a typical SLA of 6 months and low severity issues are added to the backlog without a specific deadline.
Is there a particular reason why you want to disclose the bug?
Thanks,
Frida
| Reporter | ||
Comment 19•4 years ago
|
||
I thought this bug is ignored. It is common in the bug hunting community to let people know bugs that are ignored, to raise awareness instead of malicious people finding the bug, and exploiting it for their own gain. Im glad this bug is not ignored yet
| Assignee | ||
Updated•4 years ago
|
Comment 23•4 years ago
|
||
Released to prod
| Reporter | ||
Comment 24•4 years ago
|
||
Awesome
| Reporter | ||
Comment 25•4 years ago
|
||
Hi. Any updates on the bounty?
Comment 26•4 years ago
|
||
Now that the issue is fixed, the bug bounty team will be reviewing your report over the upcoming weeks to make a determination of what if any award Mozilla will be granting for this report. It may take up to 3 weeks but know that we have not forgotten this ticket, we have a tracking system and a review cadence that will ensure that all potentially bounty eligible reports get reviewed and acted on
Updated•4 years ago
|
| Reporter | ||
Comment 27•4 years ago
|
||
Hello everyone. I am a little disappointed with the bounty amount. Isnt 500$ a little low for this bug? I waited 3 months for this bug and i only got 500$. Also, according to the bounty table, IDOR on core site is around 3000$, 500$ is very far from 3000$. Now lets say 3000$ is the highest you can get with idors, if we plugin this bug in the cvss calculator, that would be around 5.3 (Medium) with CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N . The highest you can get with the cvss calculator is 10, and 5.3 is around half of it, so a fair bounty for this bug should be around 1500$. On my previous idor report, with the same cvss score, i got what we expected which is 1500$ in 1754966 . Please take the chance to reconsider the bounty amount on this bug.
Thanks
| Reporter | ||
Comment 28•4 years ago
|
||
Alternatively, we can push the Integrity in the cvss calculator to since this doesnt require user interaction/we can upload files on any/all posts we want, and we can get a cvss score of 7.5 (High). But, we can also settle with the 5.3 (Medium) too.
Comment 29•4 years ago
|
||
This doesn't fall under what we meant by IDOR. This is effectively site vandalism, but technically a missing authorization check. We already have to deal with spammed images, so at scale this let's you hide the account of the spammer by spreading the blame. In a more targeted way an inserted image could be used to attack the reputation of the victim's account, but of course that would be public (reputation attacks have to be by nature) and would get investigated and cleared. The impact seemed minimal. Bug 1754966 is similar, but we judged the impact as "moderate" because missing images would be initially less likely to be noticed, and more work to restore (would have to dig into back-ups).
Updated•4 years ago
|
Updated•2 years ago
|
Description
•