What security issues should a React developer think about?

React 19 and architecture · Experienced

Model answer

XSS is the main one: React escapes values in JSX by default, but dangerouslySetInnerHTML, unsafe URLs (javascript: links) and third-party scripts can reintroduce it, so sanitise HTML with a library such as DOMPurify. Also: never put secrets in client code (everything shipped is public), keep dependencies updated, use a content security policy, and rely on the server for authorisation.

Learn this topic

React 19 New Features: Actions, useActionState, useOptimistic, use and More in the course React.js Full Course: Beginner to Advanced.

Sign in to add your own answer.

More questions