-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Vulnerability Details
- File Path:
orbit-app/src/components/CommentsSection.jsx - Vulnerability Type: Cross-Site Scripting (XSS)
- Risk Level: Critical
Explanation:
The code uses React's 'dangerouslySetInnerHTML' to render user-supplied comment content (cmt.comment) directly into the DOM without any sanitization. This allows attackers to submit comments containing malicious HTML or JavaScript, which will be executed in the browsers of all users viewing the comments section. This is a textbook example of a stored Cross-Site Scripting (XSS) vulnerability. The root cause is the direct injection of untrusted user input into the DOM via 'dangerouslySetInnerHTML' without proper sanitization or encoding.
attackScenario: An attacker submits a comment like '<script>alert("XSS")</script>'. When any user loads the comments section, the script executes in their browser, allowing the attacker to steal session cookies, perform actions as the user, or deface the page.
potentialImpact: Severe compromise of Confidentiality (session hijacking, data theft), Integrity (defacement, malicious actions), and Availability (potential browser crashes or DoS via script injection). The scope is changed, as the attack can affect all users viewing the page.
Please investigate and resolve this issue to maintain code security and quality.