Headline
CVE-2022-4692: XSS by uploading svg files in memos
Cross-site Scripting (XSS) - Stored in GitHub repository usememos/memos prior to 0.9.0.
Description
Hi there, Your project has a function of uploading files.That is the section named "Resource".But it does not filter the content of the uploaded files. If we upload an svg file containing malicious data and a user accesses it, xss will be triggered.
Video
Please visit my video link
https://drive.google.com/file/d/10GQODgA3evtTGYmdAivR9zYGxsarr1L0/view
Proof of Concept
1.Login as any user.
2.Click the module named "Resource".
3.Upload a svg file and the contents of this file are as follows.
<x:script xmlns:x="http://www.w3.org/1999/xhtml">alert(document.domain)</x:script>
4.Access this svg file
Impact
(1) To steal the administrator account or cookie, the intruder can log in to the background as an administrator. It enables intruders to manipulate background data maliciously, including reading, changing, adding and deleting some information.
(2) Stealing users’ personal information or login accounts will pose a huge threat to the user security of the website. For example, pretend to be a user for various operations.
(3) The website hangs horses. First, embed the malicious attack code into the Web application. When the user browses the hanging horse page, the user’s computer will be implanted with a Trojan horse.
(4) Send advertisements or spam messages. Attackers can use XSS vulnerabilities to plant advertisements or send spam, seriously affecting the normal use of users.
Occurrences
resource.go L1-L278
Hello, my suggestion is that you should detect and filter the content of the svg file.
Related news
Cross-site Scripting (XSS) - Stored in GitHub repository usememos/memos prior to 0.9.0.