Skip to content

[Precogs Alert] Cross-Site Scripting (XSS) detected (CWE-79, Risk: Critical)#29

Open
sameer6pre wants to merge 1 commit intomainfrom
Precogs-fix-zc9esz8h
Open

[Precogs Alert] Cross-Site Scripting (XSS) detected (CWE-79, Risk: Critical)#29
sameer6pre wants to merge 1 commit intomainfrom
Precogs-fix-zc9esz8h

Conversation

@sameer6pre
Copy link
Owner

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 inject arbitrary HTML or JavaScript by submitting a crafted comment, leading to stored XSS. The data flow is: user input (textarea) -> POST to backend -> fetched via GET -> rendered as raw HTML. There is no evidence of server-side or client-side sanitization.

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 theft of cookies, session tokens, or other malicious actions.

potentialImpact: Full compromise of user accounts (Confidentiality), manipulation of page content (Integrity), and potential disruption of service (Availability). The scope is changed, as one user's input can affect all users viewing the page.

Please review and address the issue accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant