-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Vulnerability Name: Cross-Site Scripting (XSS)
Description:
Cross-Site Scripting (XSS) is a security vulnerability typically found in web applications. It allows an attacker to inject malicious scripts into web pages viewed by other users. These scripts can hijack user sessions, deface websites, or redirect the user to malicious sites.
Impact:
Session hijacking
Data theft (cookies, session tokens)
Defacement of web pages
Malware distribution
Redirection to malicious websites
Step to Reproduce:
1.Open the following URL in your web browser: https://technodes2-0.github.io/Interview-Bot/
2.In the "name" field, input HTML tags like <img src=x> along with entering a random profession.
3.After logging in, observe the broken image tag indicating the successful injection of HTML.
4.Further, input the following string in the "name" field: helllo<h1>helo</h1>
5.Note the HTML tags are rendered as plain text.
6.Now, inject a JavaScript payload in the "name" field: <img src=x onerror=alert("hacked")>
7.After logging in again, observe that the JavaScript payload executes, demonstrating successful XSS.
Recommendation:
Validate and sanitize user inputs to strip out or encode HTML, JavaScript, and other potentially dangerous content.
Encode output to ensure that any user-generated content is treated as plain text rather than executable code.
Implement a strict CSP to mitigate the impact of XSS attacks by restricting the sources from which certain types of content can be loaded.





