Skip to content

XSS vulnerability: player names and ploys are not sanitized #6

@EliotGodard

Description

@EliotGodard

Problem

Player names and ploys are passed through Socket.IO and injected into the DOM via jQuery .html(). A player could submit <script>alert(1)</script> as their name or ploy and execute arbitrary JavaScript on all connected clients.

Suggested fix

Sanitize all user input before rendering. Use .text() instead of .html() for user-supplied content, or apply HTML entity escaping server-side before broadcasting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity vulnerability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions