Skip to content

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

@sameer6pre

Description

@sameer6pre

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 investigate and resolve this issue to maintain code security and quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions