React & Next.js

Security vulnerabilities specific to React and Next.js applications. XSS via dangerouslySetInnerHTML, token storage, source maps, CORS, and middleware issues.

7 vulnerabilities

dangerouslySetInnerHTML Without Sanitization

high

Using React's dangerouslySetInnerHTML with unsanitized user input allows attackers to inject malicious scripts that execute in other users' browsers.

CWE-79A03:2021

Authentication Tokens in localStorage

high

Storing JWT tokens, session tokens, or API keys in localStorage makes them accessible to any JavaScript running on the page, including XSS payloads.

CWE-922A07:2021

__NEXT_DATA__ Secrets Exposure

high

Next.js page props passed through getServerSideProps or getStaticProps leak sensitive data like API keys, database URLs, or internal configuration via the __NEXT_DATA__ script tag.

CWE-200A01:2021

Source Maps Exposed in Production

medium

JavaScript source map files (.map) are publicly accessible in production, revealing the complete original source code including comments, variable names, and internal logic.

CWE-540A05:2021

Open CORS in Next.js API Routes

medium

Next.js API routes configured with Access-Control-Allow-Origin: * allow any website to make authenticated cross-origin requests, enabling CSRF-like attacks.

CWE-942A05:2021

No CSRF on Server Actions

medium

Server Actions called from malicious third-party sites without origin validation, letting attackers trigger state-changing requests on behalf of logged-in users.

CWE-352A01:2021

Next.js Middleware Bypass (CVE-2025-29927)

critical

A critical vulnerability in Next.js versions before 15.2.3 allows attackers to bypass middleware-based auth checks entirely by sending a crafted internal header.

CWE-863A01:2021