Skip to content

Access control

API route returns data without a loginruntime.api-data-without-session

A GET to one of your API routes with no cookies returns JSON data — personal fields make it high; a route the code protects that answers anyway is observed. Routes whose GET may change state are never requested.

  • In force Rule runtime.api-data-without-session
  • 3 clauses

At a glance

runtime.api-data-without-session
Severityhigh
CertaintyObserved — the code as written is the problem
Looks atyour running app, in a real browser
When it runsRuns with --runtime, against your app on localhost

How to fix it

Check the session first and return 401; scope queries to the signed-in user.

Check your own app

Run npx scanlyfix scan --runtime 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 runtime.api-data-without-session -- <why>.

All rules

Your code stays
on your machine

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