Enhancing ReactJS Application Security: XSS Scripting and Client-Side Defense
Where
Talks
LASCON 2023
Duration
59 min
Surveys XSS and client-side defenses for ReactJS apps, plus API, token and access control risks developers face.
Summary
The talk opens with where security bugs come from in modern software: developer-written code, third-party libraries, and cloud configuration. The speaker argues for security gates in the devops pipeline, automated testing on every commit, requirements tailored to each team from the ASVS, and threat modeling generated from API traffic rather than whiteboard interviews.
The middle section is a broad tour of web and API defenses. Topics include session cookies and security headers, sandboxed iframes, CORS behavior once applications move to microservices, REST pitfalls such as sensitive data in URLs, server-side request forgery, JSON parsing and deserialization, JWT signature checks and token revocation, SQL injection through input that passes validation, CSRF, file upload handling, prompt injection in LLM applications, and the OWASP Top 10. Broken access control is highlighted as a business logic gap that common scanners miss.
For ReactJS specifically, the focus is cross-site scripting. The talk recommends context-appropriate output escaping, a sanitizer such as DOMPurify for user-authored HTML, and validating URL protocols before rendering links, since JavaScript URLs can bypass React's protections. The takeaway is that client-side code needs its own defenses, and that authorization checks belong in the data layer rather than in hardcoded roles.
Related talks
Talks·35 min
Ankush Jain · Ankita Gupta
Shows how to catch broken authorization flaws in CI/CD pipelines using staging tests for IDOR, roles, permissions and plans.
Talks·21 min
Falcon Darkstar Momot
Argues that output encoding and structured intermediate representations work better than input sanitization for preventing injection attacks.
Talks·46 min
Abraham Aranguren
Shows how to audit Electron desktop apps and chain XSS into code execution through node integration, preload scripts and IPC.


