Strapi is a headless CMS, so a compromise can sit in two places: the Strapi backend (admin panel, API, database, server) or the separate frontend that displays its content. The signs below help you work out which one you are dealing with, and what to do first.
Many Strapi projects are self-hosted, which means you or your developer are responsible for updating Strapi, its plugins and Node.js. Strapi Cloud customers have a different split of responsibilities, so check what your plan covers.
Signs your Strapi site may be compromised
No single sign proves a compromise, and most have innocent explanations. Several together, or one you cannot explain, justify a closer look.
- Admin users you did not create. A new Super Admin account, or an existing editor whose role was quietly upgraded.
- Unfamiliar API tokens. Tokens you do not recognise, or a token with full access that your team never needed.
- Content you did not write. Entries edited or published without a matching team member, spam text or links inside rich-text fields, or new entries in content types you rarely use.
- Changed public permissions. The Public role suddenly allows actions such as create, update or delete on a content type.
- Unexpected redirects or spam pages. Visitors sent elsewhere, or pages you never made appearing in search results. Strapi does not manage redirects by itself, so check wherever your project handles them: the frontend, a plugin, a proxy or your DNS and CDN settings.
- Injected scripts. Unknown JavaScript on your public pages, often loading from a domain you do not use.
- Search or browser warnings. Security or deceptive-content notices in Google Search Console or in a browser.
- Server symptoms. Unexplained load, unknown processes, files you did not deploy, or outbound traffic you cannot account for.
How to confirm what happened
Work from the most reliable evidence to the least. Avoid changing things until you have noted what you found, because tidy-up work can destroy the trail.
Check admin users and roles
In the admin panel, open the settings area and review the list of administrators and their roles. Every account should belong to a person you can name. Note any you cannot identify, along with the roles of accounts you do recognise.
Check API tokens and public permissions
Review the API tokens in the settings area, including their type and which content they can reach. Then look at the Users & Permissions plugin and compare the Public and Authenticated roles against what your frontend genuinely needs. Public access that is wider than necessary is both a risk and a clue.
Look for content changes
Use the Content Manager to sort entries by last updated and look at recent edits. Check the Media Library for files you did not upload. Whether Strapi can tell you who made a change depends on your edition and plan: some editions include audit logs, others do not. If you have no audit trail, your server logs and database backups become your main evidence.
Inspect what visitors actually receive
Load your public pages while logged out and view the source. Look for script tags, iframes or links you did not add. Compare against a clean copy of your frontend build. If the frontend is fine but the API returns bad content, the problem is in Strapi or its database. If the API content is clean but pages are altered, look at the frontend, CDN or hosting layer instead.
Review the server and dependencies
Check your server access logs for requests to the admin panel from unfamiliar places, repeated login attempts, and unusual requests to the API. Compare the files on the server against your repository, and review your package.json and lock file for packages you did not add. The Strapi documentation covers configuration, environment variables and deployment, which helps you spot settings that differ from your intended setup.
Check search tools
If you use Google Search Console, look at its security issues and manual actions reports, and search for your domain together with words like casino or pills to find spam pages that were indexed.
First steps to take
Once you believe something is wrong, move in this order.
- Preserve evidence. Take a copy of server logs, a database backup and the current file state before you change anything.
- Contain it. If visitors are at risk, put the site in maintenance mode or restrict access to the admin panel while you investigate.
- Remove unknown admin users and revoke suspicious API tokens. Reset passwords for every remaining admin, and ask them to use unique passwords.
- Rotate secrets. Strapi projects keep secrets in environment variables, such as the keys that sign admin sessions and API tokens. Generate new values, along with database credentials and any third-party keys stored on the server. Changing the signing secrets will sign out existing sessions.
- Restore from a known-good state. If you have a clean backup from before the first sign of trouble, restoring is usually safer than hand-cleaning. Redeploy the application code from your repository rather than editing files on the server.
- Update everything. Update Strapi, installed plugins and Node.js, and remove plugins you no longer use.
- Clean the content. Remove spam entries and injected text, then clear caches on your CDN and frontend.
- Ask for a review. If Google flagged the site, fix the problem first and then request a review in Search Console.
Reduce the chance of a repeat
After recovery, close the gaps that let it happen. Keep the admin panel behind additional protection where your hosting allows, such as an IP allowlist or VPN. Give each person the narrowest role they need, and use API tokens with the least access that works. Store secrets outside the repository, and take regular backups that you have tested restoring.
A Content Security Policy tells browsers which script sources your pages may load, which limits the damage from an injected script. The MDN guide to Content Security Policy explains how it works. For a broader checklist of common web application weaknesses, the OWASP Top Ten is a stable reference to review with your developer.
Frequently asked questions
Is a Strapi site hacked if I find an admin user I do not recognise?
It is a serious warning, but first check whether a colleague, contractor or former developer created it. If nobody can account for it, treat it as unauthorised access and follow the containment steps above.
Does Strapi Cloud mean I do not have to worry about this?
Not entirely. Strapi Cloud changes who looks after the hosting and platform, but your admin users, roles, API tokens, public permissions and project code are still yours to manage. Check the vendor’s documentation for the exact split on your plan.
Can I just delete the spam content and carry on?
Deleting it treats the symptom only. If the attacker still has an admin account, a token or server access, the content will return. Find and close the way in, rotate secrets, and then clean the content.