Join our Newsletter — 33% off our NHI Course
Home› Guides› Strapi Security Guide: Admin Panel, API Tokens, Roles…
Guide Application Security

Strapi Security Guide: Admin Panel, API Tokens, Roles and Plugin Risk

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 19 November 2026 17 min read
On this page

Strapi security comes down to four things: who can reach the admin panel, which API tokens exist and what they can do, how roles are scoped for people and for anonymous callers, and what code runs inside the server through plugins and dependencies. Strapi is a Node.js headless CMS, which means every front end, build job and integration that reads or writes content does so with a credential. Those credentials are non-human identities, and most Strapi incidents trace back to one of them being too broad, too long-lived or exposed where it should not be.

This is an independent guide from NHI Mgmt Group, based on Strapi's public documentation as of November 2026. It is not sponsored or reviewed by Strapi. Product features change, so confirm settings against Strapi's current documentation.

Key takeaways

  • Strapi has two separate identity planes: administrators in the admin panel, governed by admin RBAC, and end users and anonymous callers on the Content API, governed by the Users and Permissions plugin. Review both.
  • Any request to the Content API without a token is treated as the Public role. A permission left enabled on Public is open to the whole internet.
  • API tokens come as Read-only, Full access and Custom, with durations of 7, 30 or 90 days or Unlimited. Strapi pre-generates one Full access and one Read-only token, so check whether they are still needed.
  • The admin JWT secret, the API token salt, the encryption key and the transfer token salt are secrets. Changing the API token salt invalidates every existing API token, which makes it your emergency revoke switch.
  • The CORS middleware defaults to an origin of * with credentials allowed. Set an explicit list of origins for production.
  • Strapi 4 reached end of security updates in April 2026. Only Strapi 5 receives fixes, so any remaining v4 instance is unpatched by design.
  • Plugins and npm dependencies run with the full privileges of the Strapi process and its database and token secrets. Treat each plugin as code you are taking responsibility for.

How identity works in Strapi

A Strapi project exposes two surfaces. The admin panel, served by default at /admin, is where editors, developers and administrators manage content types, content and settings. The Content API, delivered over REST or GraphQL, is what websites, apps and integrations call to read and write content.

Each surface has its own identity model:

  • Administrators sign in to the admin panel. Their access is controlled by admin role-based access control, with default roles of Super Admin, Editor and Author. Admin sessions are backed by JWTs signed with the admin auth secret.
  • End users authenticate against the Content API through the Users and Permissions plugin, which has two default roles, Authenticated and Public. They receive JWTs signed with a separate JWT secret.
  • Machines such as static site builders, mobile back ends and integration services normally use API tokens, which are bearer credentials sent in the Authorization header.

Content API tokens are rejected on admin routes, and admin tokens are rejected on Content API routes, so each plane needs its own review.

Every API token, service-held JWT, admin automation token and data transfer token is a non-human identity with an owner, scope, lifetime and storage location. The Non-Human Identity (NHI) Guide sets out the inventory approach.

Securing the admin panel

The admin panel is the highest value target in a Strapi deployment. A compromised administrator can change content types, create tokens, alter roles and, depending on the plugins installed, reach the server itself. An admin login page reachable from the internet is open to password guessing and to anyone holding a leaked credential.

Exposure

Strapi's admin configuration lets you set the admin url, host and port, and choose whether the Strapi server serves the panel at all through serveAdminPanel. The documentation states that the admin panel should always be exposed through HTTPS in production. Our recommendation goes further: do not leave the admin panel reachable from the open internet unless there is a strong reason. Options include restricting it at the reverse proxy or load balancer to a VPN or corporate network range, using an identity-aware proxy in front of it, or applying the strapi::ip middleware, which is not enabled by default, with a whitelist of trusted ranges.

Admin sessions and cookies

Strapi 5 admin sessions use short-lived access tokens and refresh tokens. The documented defaults are an access token lifespan of 1,800 seconds (30 minutes), a maximum refresh token lifespan of 30 days, an idle refresh token lifespan of 14 days, a maximum session lifespan of 30 days and an idle session lifespan of two hours. Tokens are signed with HS256 by default, and asymmetric algorithms are supported if you supply a private and public key.

The admin cookie is set secure automatically in production over HTTPS, and Strapi logs a warning if that is turned off. Leave it on, and shorten session lifespans if they exceed your wider session policy.

Login protection

Admin authentication endpoints are rate limited by default: rateLimit.enabled is true, with a maximum of five requests in a five-minute window, responses delayed after the first request, and a wait of 3,000 milliseconds. The default store is in memory, which does not share state between instances. If you run several Strapi replicas behind a load balancer, configure a shared store such as Redis so the limit applies across the cluster.

Single sign-on

Where SSO is enabled, each administrator can be set to sign in with SSO or not. Use it for every human administrator so your identity provider's MFA and leaver processes apply, and keep a vaulted break-glass account that alerts on use.

API tokens: types, lifetimes and storage

API tokens are created at Settings, Global settings, API Tokens, with a name, an optional description, a duration and a type. The documented options are:

SettingOptionsNotes
TypeRead-only, Full access, CustomRead-only tokens can only use the find and findOne functions. Custom tokens let you enable permissions per content type.
Duration7 days, 30 days, 90 days, UnlimitedSet at creation.
RegenerateFrom the token's edit viewIssues a new value for the same token entry.
VisibilityViewable later, or once onlyDepends on whether an encryption key is set in admin.secrets.encryptionKey.

Strapi pre-generates one Full access token and one Read-only token in a new project. Review them on day one. If no system uses them, delete them. If something does, replace them with named Custom tokens that carry only the permissions that system needs.

Choosing the right type

Strapi's own guidance is to prefer read-only tokens for public access, scope tokens to only what is needed, rotate long-lived tokens and store tokens in a secrets manager. A front end that only reads content needs a Read-only or narrow Custom token. A Full access token with Unlimited duration is, in effect, a permanent administrator key for the Content API and should be rare, owned and time limited.

Lifetimes and rotation

Choose the shortest duration you can operate, and require an owner and review date for Unlimited tokens. Regenerating a token stops the old value working, so coordinate with the consumer or switch between two tokens. The API Key Management Guide covers rotation patterns.

Where tokens end up

Strapi tokens are bearer credentials, so anyone holding one can use it. The usual leak paths are front-end bundles that embed a token for client-side fetches, CI logs, environment files committed to repositories and shared chat messages. A token that ships to a browser is public, whatever its type. If a front end needs data at runtime, give it a Read-only token limited to published content it would show anyway, or proxy requests through a back end that holds the token. Store every other token in a secrets manager and inject it at runtime, as described in the Secrets Management Guide.

Visibility and the encryption key

With admin.secrets.encryptionKey set, which new projects get automatically, tokens stay viewable in the admin panel; without it they are shown once. Either way, restrict the permission "Access the API tokens settings page" to the smallest group possible.

Configuration secrets and salts

Several values in Strapi configuration are secrets in their own right. Placeholder values in the documentation, such as someSecretKey, someRandomLongString and anotherRandomLongString, must be replaced with values from your environment. The key ones are:

SettingPurposeImpact if exposed or changed
auth.secret (often ADMIN_JWT_SECRET)Signs admin JWTs. Required when the server serves the admin panel.Exposure could allow forged admin tokens. Rotation ends admin sessions.
apiToken.salt (API_TOKEN_SALT)Salt for API tokens of both the content API and admin kinds.Changing it invalidates all existing API tokens.
secrets.encryptionKey (often ENCRYPTION_KEY)Encrypts stored token values so they can be shown in the panel.Exposure alongside a database copy could reveal tokens.
transfer.token.saltSalt for data transfer tokens.If unset, data transfer is disabled.
jwtSecret (often JWT_SECRET)Signs Users and Permissions JWTs for end users.Exposure could allow forged end user tokens.

Load these values from a secrets manager at start-up, never from the repository or image, and use different values per environment.

The API token salt deserves special mention. Because changing it invalidates every API token at once, it is your fastest way to cut off all machine access to the Content API during an incident. Document this in your runbook, along with the list of systems that will need new tokens afterwards. If you do not need data transfer between environments, leaving transfer.token.salt unset keeps that feature disabled and removes a class of powerful token from the estate.

Admin roles and least privilege

Strapi's admin RBAC is available on the free plan and active by default. The default roles are Super Admin, which has access to all features and settings and whose permissions cannot be edited; Editor, which can create content and manage and publish any content; and Author, which creates and manages its own content. The first administrator receives the Super Admin role.

Permissions can be set for collection and single types, with create, read, update, delete and publish actions, down to individual fields, and per locale when internationalisation is installed. Plugins such as the Content Manager, Content-Type Builder, Media Library upload and Users and Permissions each have their own permissions, and settings sub-categories are controlled separately. Two default conditions are available: the administrator is the creator of the content, or the administrator has the same role as the creator. Custom conditions can be added in code.

Keep Super Admin to two named people plus a break-glass account, remove Content-Type Builder access from content roles, separate access to sensitive settings such as API tokens and SSO from content work, and use field-level permissions and the creator condition to narrow what editors and authors can change.

Non-Super Admins can only grant permissions they hold themselves, which limits escalation through role editing but not broad roles given to the wrong person, so review membership regularly. Audit Logs require an Enterprise plan, with a documented default retention of 90 days. The Least Privilege Techniques Guide covers review cadence.

End users, the Public role and JWTs

The Users and Permissions plugin controls who can call the Content API as an end user. Its documentation states that any request without a token assumes the Public role permissions by default. The Public role cannot be deleted, and users of a deleted role are moved to Public. This single fact is behind many Strapi data exposures: a developer enables find on a content type for Public during testing, or enables create to make a form work, and the setting reaches production.

Review the Public role like a firewall rule set, and handle forms through a validated, rate limited custom route rather than an open create permission.

Registration

Users who register through /api/auth/local/register, or who are created without a role, receive the Authenticated role. Admin settings include whether sign-ups are enabled, whether email confirmation is required and the redirect URLs used. If your site does not offer public accounts, disable sign-ups. If it does, require email confirmation, and remember that every self-registered user holds whatever the Authenticated role allows. Custom registration fields must be listed in config.register.allowedFields or the API rejects them, which helps prevent users from setting fields such as a role at sign-up. Keep that list short.

JWT lifetimes

End user JWTs are signed with jwtSecret. The plugin supports two modes through jwtManagement: legacy-support, the default, which issues long-lived JWTs, and refresh, which issues short-lived access tokens with refresh tokens. In refresh mode the documented defaults are an access token lifespan of 600 seconds, a maximum refresh token lifespan of 30 days and an idle refresh token lifespan of 14 days. Authenticated users can list and revoke their own sessions through the REST API. The documentation warns that an expiry over 30 days is not recommended in legacy mode. We recommend refresh mode for new projects, because it shortens the window in which a stolen token is useful and adds a revocation path. The JWT Security Guide covers validation and storage on the client side.

Authentication and registration endpoints are rate limited by default, at ten requests per minute. As with the admin limiter, use a shared store when running more than one instance.

Middlewares: CORS, headers and body limits

Strapi applies only the middlewares listed in ./config/middlewares.js, in the order given. Several of the defaults deserve a production review:

  • strapi::cors defaults to an origin of *, with credentials set to true. For production, set origin to an explicit list of the front ends that call the API. See the CORS Misconfiguration Guide for why wildcard origins are risky.
  • strapi::security is based on koa-helmet. HSTS defaults to a max age of 31,536,000 seconds with subdomains included, and frame guard defaults to sameorigin. The default Content Security Policy includes the Strapi marketplace asset host. If you use an external upload provider such as an object storage bucket, you will need to add its host to img-src and media-src. Add only the hosts you need.
  • strapi::body limits JSON bodies to 1 MB and form and text bodies to 56 KB by default, with multipart enabled. Raise these only where a route needs it, and keep upload size limits aligned with what editors actually upload.
  • strapi::ip is not enabled by default. It supports whitelist and blacklist entries with wildcards and ranges, and is a simple way to restrict admin access where a network control is not available.
  • strapi::poweredBy adds an X-Powered-By header with a value of Strapi <strapi.io> by default. It is not required. Removing it or overriding the value takes Strapi out of the most basic fingerprinting.

Plugin and dependency risk

Strapi plugins are npm packages that run inside the server process, with the same reach as Strapi itself, including the environment variables that hold its secrets. Plugin choice is a supply chain decision.

Our recommendations for managing plugin risk:

  • Keep an allow list. Record each plugin, its source, its maintainer, the version in use and the business owner. Remove plugins nobody can explain.
  • Check maintenance and version support. A plugin that has not been updated for Strapi 5 is a reason to keep a Strapi 4 instance alive, and Strapi 4 no longer gets security updates.
  • Review routes and permissions. After installing a plugin, check which new routes it exposes on the Content API and whether they appear in the Public role. Check which new admin permissions it adds and assign them deliberately.
  • Lock and verify dependencies. Commit a lockfile, install with a clean install in CI, and review install scripts. The npm Install-Time Security Guide covers install-time risks that apply to every Strapi build.

Patching and Strapi's security advisories

Strapi's security policy states that, as of May 2026, only Strapi 5 GA and stable releases receive updates and bug fixes. Strapi 4 support ended in October 2025, with security updates until April 2026, and it is now end of life. Any Strapi 3 or 4 instance in your estate should be on a migration plan with a date.

Vulnerabilities are reported through GitHub Security Advisories, and Strapi publishes advisories on the strapi/strapi security advisories page after an embargo. The policy describes the process: once a report is confirmed, Strapi aims to release a patch quickly, and the patch ships first with a warning in the release notes on the releases page. Detailed disclosure follows two to eight weeks later depending on severity, and paying customers and partners receive advance notice under confidentiality terms.

The first public signal of a Strapi security fix is therefore often a release note warning, not a CVE. Subscribe to Strapi releases, treat any security warning as a patch trigger, and upgrade before the detailed advisory is published.

Common failure patterns

  • Public role left open. A find or create permission enabled for testing reaches production and exposes data or allows anonymous writes.
  • Default tokens kept. The pre-generated Full access token is used by a front end or shared between teams, with Unlimited duration and no owner.
  • Tokens in the browser. A token is bundled into client-side code for convenience, making it public whatever its type.
  • Admin panel on the internet. The panel is reachable from anywhere, protected only by passwords, with no SSO or network restriction.
  • Wildcard CORS with credentials. The default * origin is left in place in production.
  • Unpatched major versions. A Strapi 4 instance kept alive for one plugin, now past end of security updates.

Practitioner checklist

  • Inventory every Strapi instance, its version and its installed plugins, and plan migration for anything below Strapi 5.
  • Restrict admin panel access by network or identity-aware proxy, serve it only over HTTPS, and enable SSO for human administrators.
  • Limit Super Admin to a small named group and a vaulted break-glass account. Remove Content-Type Builder access from content roles.
  • Delete or replace the pre-generated Full access and Read-only tokens. Give every remaining token a name, owner, scope and finite duration.
  • Store all tokens and configuration secrets in a secrets manager, with distinct values per environment. Replace any placeholder values.
  • Record in your runbook that changing API_TOKEN_SALT revokes all API tokens, and list the systems that will need new tokens.
  • Review the Public and Authenticated roles action by action. Disable sign-ups if you do not offer public accounts, and require email confirmation if you do.
  • Switch end user authentication to refresh mode, and keep token lifetimes short.
  • Set an explicit CORS origin list, tune the Content Security Policy to the hosts you use, and remove or override the X-Powered-By header.
  • Use a shared rate limit store when running more than one instance.
  • Subscribe to Strapi releases and treat release note security warnings as a patch trigger.

Standards and references

Related NHI Mgmt Group resources: API Key Management Guide · Secrets Management Guide · JWT Security Guide · CORS Misconfiguration Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.