Skip to content

Access control

Server action changes data without checking who is callingaccess.server-action-no-auth

Every exported function in a "use server" file is a public HTTP endpoint — Next.js gives it an id that the browser can call with any arguments, from any page, signed in or not. This one writes data and never checks the session.

  • In force Rule access.server-action-no-auth
  • 3 clauses

At a glance

access.server-action-no-auth
Severityhigh
CertaintyNeeds review — a heuristic; confirm before changing code
Looks atyour source code
When it runsRuns on every scan

How to fix it

Authenticate inside the action itself (not only on the page that renders the form), and check the caller owns whatever the arguments point at.

Check your own app

Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.

If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line access.server-action-no-auth -- <why>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.