---
title: "Discussion on \"Securing Next.js Server Actions: a 10-point checklist for 2026\" | Hashnode"
description: "Discussion on \"Securing Next.js Server Actions: a 10-point checklist for 2026\". Every exported Server Action is a public POST endpoint. Here's what Next.js protects for you, what it doesn't, and the ten checks I put on every action: auth, ownership, validation, cookies, rate limits and more."
url: "https://hashnode.com/posts/secure-nextjs-server-actions/6ae0f5a1e8645c6ca9f59a08"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Securing Next.js Server Actions: a 10-point checklist for 2026](https://vishalsolanki.hashnode.dev/secure-nextjs-server-actions?utm_source=hashnode&utm_medium=feed)

Every exported Server Action is a public POST endpoint. Here's what Next.js protects for you, what it doesn't, and the ten checks I put on every action: auth, ownership, validation, cookies, rate limits and more.

Oct 27 · 10 min read · vishalsolanki.hashnode.dev  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#security](https://hashnode.com/tag/security)
-   [#react](https://hashnode.com/tag/react)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Vishal Solanki](https://hashnode.com/@vishalsolanki)

@vishalsolanki · Noida, India

  
[View profile](https://hashnode.com/@vishalsolanki)

Full-Stack Developer · Next.js, React, Node.js · Noida, India

I design, build and grow websites, web apps and SaaS products with Next.js, React, Node.js and TypeScript. I write about Next.js, technical SEO, AI search and web performance. Case studies: https://www.vishalsolanki.online

## Responses 2

Markdown supported · ⌘↵ to post

[Tarun Sharma](https://hashnode.com/@101beardo)

[Oct 28](https://hashnode.com/posts/secure-nextjs-server-actions/6ae0f5a1e8645c6ca9f59a08/comment/6ae1f0e6ec3b6bb0091bc8ca)

On point 7, the rate limit key uses the first x-forwarded-for value, and that one is set by the client. If the host doesn't overwrite the header, someone can rotate it per request and never hit the limit. Using the platform's own client IP header, or the last trusted hop, closes that, and it's worth pairing the IP with the account or email for OTP routes.

[Vishal Solanki](https://hashnode.com/@vishalsolanki)

[Oct 28](https://hashnode.com/posts/secure-nextjs-server-actions/6ae0f5a1e8645c6ca9f59a08/comment/6ae1f0e6ec3b6bb0091bc8ca#reply-6ae2112bb78e490adba0e5b2)

Hi Tarun! You're right - trusting the first `X-Forwarded-For` value without verifying how the proxy handles it can make the rate limit spoofable. The correct approach is to use the hosting platform's trusted client-IP header or derive the IP from a properly configured trusted proxy chain. Pairing IP-based limits with account or email-based limits for OTP routes adds another layer of protection. I'll clarify this in the example.
