Next.js fixes
28 guides include a Next.js section. This page only lists those sections. It is not a copy of the full catalog, and a sponsor does not change which guides appear or their order.
- criticalUpdated Oct 18, 2026
Auth checked only in the UI in Next.js
In every Route Handler and Server Action that reads or writes user data, load the session from cookies or from your auth library on the server, and stop when there is no user. Do the same for admin actions with an explicit role check stored somewhere the user cannot edit.
- criticalUpdated Oct 18, 2026
Auth in middleware that skips API routes in Next.js
Check the session inside every Route Handler and Server Action that reads or writes user data. Middleware or proxy can be an extra filter.
- criticalUpdated Nov 20, 2026
Exposed .env files and debug endpoints in Next.js
Delete debug routes or guard them so they cannot run in production. Prefer deleting them.
- criticalUpdated Oct 13, 2026
Firebase rules left open in Next.js
If an Admin SDK service account is used on the server, rules do not apply to that SDK. Check the session in the Route Handler, the same as a Supabase secret key.
- criticalUpdated Oct 25, 2026
How to check if RLS is enabled on every Supabase table in Next.js
If a Server Component or Route Handler uses the secret key, RLS does not run. Filter by the signed-in user's id in that query, or stop using the secret key for ordinary user requests and use the publishable key plus the user's session so RLS applies.
- criticalUpdated Oct 13, 2026
IDOR: reading or changing someone else's data in Next.js
Take the user id from the session. Use the object's id from the URL only as a lookup inside that user's rows.
- criticalUpdated Oct 14, 2026
Keys committed to GitHub in Next.js
Read secrets from the environment at runtime on the server. Do not default them in source code "for local dev." Use .env.local , which Next.js gitignores in a typical app, and keep .env.example free of real values.
- criticalUpdated Oct 23, 2026
No cap on LLM API spend in Next.js
ts const DAILY_LIMIT = 20;
- criticalUpdated Oct 19, 2026
Open storage buckets in Next.js
The route that mints a signed URL has to authenticate the caller and authorize the path. A route that signs whatever ?path= it receives is an IDOR.
- criticalUpdated Oct 23, 2026
Secret keys shipped in the frontend in Next.js
Assume every NEXT_PUBLIC_ value is public. Do not pass a secret as a prop into a client component.
- criticalUpdated Oct 29, 2026
Server Actions with no auth check in Next.js
Use the action example in the full guide: session first, then input validation, then an ownership check on the id, then the write. An action that takes arguments instead of FormData needs the same four steps.
- criticalUpdated Oct 18, 2026
Session tokens stored in localStorage in Next.js
Keep the session on the server. Set an HttpOnly , Secure , SameSite=Strict cookie from your auth route or from a backend-for-frontend.
- criticalUpdated Oct 13, 2026
The client sets the price, role, or plan in Next.js
Assign fields explicitly:
- criticalUpdated Oct 13, 2026
Unverified Stripe webhooks in Next.js
ts import Stripe from "stripe";
- highUpdated Oct 13, 2026
CORS wide open in Next.js
ts const allowed = new Set([ "https://your-app.example", ]);
- highUpdated Oct 18, 2026
Cross-site scripting (XSS) in Next.js
Render user text as text. If you need formatting, use a markdown renderer that does not pass raw HTML through, or sanitize with a maintained HTML sanitizer and a strict allowlist (no script , no event handlers, no javascript: URLs).
- highUpdated Oct 13, 2026
No rate limiting on auth or paid API routes in Next.js
Before the expensive call, reject when this user or IP has exceeded a small budget for the window. Store the count in Redis, your database, or a rate-limit service.
- highUpdated Nov 13, 2026
Prompt injection in LLM features in Next.js
Keep the system instruction in a fixed string you wrote. Pass user content and retrieved documents as separate user or tool messages, and wrap them in a delimiter you tell the model is data.
- highUpdated Oct 28, 2026
Public env vars, the Supabase anon key, and row level security in Next.js
By default, Next.js exposes a browser value only when the name starts with NEXT_PUBLIC_ . A name without that prefix stays in the Node.js environment, so server code can read process.env.SUPABASE_SECRET_KEY .
- highUpdated Oct 13, 2026
SQL injection in Next.js
With Prisma, use the tagged template prisma.$queryRaw , which parameterizes interpolations. Do not use $queryRawUnsafe with a built string.
- highUpdated Nov 12, 2026
New Supabase tables need an explicit grant in Next.js
The changelog says a Next.js app is in scope when it reads or writes public through supabase-js or HTTP to /rest/v1/ or /graphql/v1 , and out of scope when it uses a direct Postgres connection string. The missing grant is SQL.
- highUpdated Oct 13, 2026
Unsafe file uploads in Next.js
Limit size before you buffer the whole file. Allow a short list of types you actually need (for example PNG, JPEG, WebP).
- highUpdated Oct 18, 2026
Weak password reset in Next.js
If you implement reset yourself because you hash passwords in your own table:
- highUpdated Oct 20, 2026
Which Vercel env vars should be Secret? How to check yours in Next.js
Move any private credential out of a NEXT_PUBLIC_ name. The Next.js docs say a variable without that prefix is only available in the Node.js environment, so read it in a Route Handler, a Server Component, or a Server Action, and send the browser only the result.
- mediumUpdated Oct 14, 2026
Missing privacy policy and terms in Next.js
Add two routes, /privacy and /terms , linked from the footer on every page including signup. Write them from the data you actually collect.
- mediumUpdated Oct 20, 2026
Missing security headers in Next.js
Use the headers() config above. Add { key: "X-Frame-Options", value: "DENY" } to the same array if you want the older frame control too.
- mediumUpdated Oct 14, 2026
Outdated dependencies in Next.js
Update the framework and the packages your routes import first. Rebuild and click through login, checkout, and a write to the database.
- mediumUpdated Oct 14, 2026
Run Cloudflare's security-audit skill in Next.js
The skill reads source. It does not, by itself, open your deployed URL.
Recently updated
Guides
Platform fixes
Incidents
- @sentry/nextjs tunnelRoute skipped Next.js middleware for more paths than it forwards to Sentry
- An encoded URL could skip Next.js middleware and get a protected page from the OpenNext Cloudflare cache
- Crafted requests to a Next.js Server Action can stall the process
- Next.js image optimization can run code from a crafted SVG
How an entry gets onto a platform page is described in the editorial standards.