WordPress · Drupal · Site Maintenance · Technical SEO · Editorial Policy

How to Tell if Your Prismic Site Has Been Compromised

A Prismic site has two parts that can be attacked, and they fail in different ways. Prismic runs the hosted content backend. Your team controls the repository’s users and roles, its API access tokens, its webhooks, and the front-end app you deploy yourself, often built with a framework such as Next.js and a tree of npm dependencies. A compromise usually sits in one of those areas you control, not in Prismic’s infrastructure.

This guide shows what to look for in each area, how to confirm what you find, and what to do first. Some details depend on your Prismic plan, your hosting and how your front end is built, so treat the steps as a framework and adapt them.

Why a headless site needs a different check

On a traditional CMS, the admin area and the public site live in one place. With Prismic they are separate. Editors sign in to Prismic, and your visitors see a front-end application that fetches content from Prismic and renders it. That gives you three places to inspect:

  • The Prismic repository: who can log in, what content changed, which tokens and webhooks exist.
  • The front-end code and its build pipeline: your Git repository, dependencies, environment variables and deploy settings.
  • The hosting and DNS layer: where the built site is served and who controls the domain.

Content tampering shows up in Prismic. Injected scripts and redirects usually show up in the front-end code or hosting. Start with the symptom, then work out which layer it points to.

Signs something is wrong

Unexpected users or changed roles

Open the repository’s user settings and compare the list with the people who should have access. Look for people you do not recognise, former staff or contractors who still have access, and anyone whose role is higher than their job needs. A new user with broad permissions is a common way to keep access after a first break-in.

Content you did not write

Spam links, odd product claims, changed contact details or new documents nobody on the team created all point to a compromised account or token. Check the publishing history. Prismic keeps document versions, and how far back that history goes can depend on your plan. Note who published each change and when.

Changed redirects

Redirects on a Prismic site are rarely stored in Prismic. They usually live in your front-end config, such as a framework redirect file, in hosting settings, or at your CDN. If visitors land on an unrelated site, or only some visitors are redirected, such as those arriving from search results, review those places, not the repository.

Spam pages and injected scripts

Pages that you never built can appear in two ways. Someone with write access may have published documents that your front end renders as pages. Or altered front-end code may serve extra routes. Scripts you do not recognise can come from a changed layout file, a tampered dependency, or a tag manager container that someone else can edit. Unfamiliar third-party domains in your page source deserve attention.

Search warnings and strange traffic

A browser security warning, a flagged-site notice in Google Search Console, or search results showing titles and descriptions you did not write all suggest content or scripts have been altered. Search engines sometimes show spam titles only to crawlers, so check as a crawler would, using the URL inspection tool in Search Console.

How to confirm what happened

Work through the layers in order. Take notes and screenshots as you go, because you may need them later.

  1. Review repository users. Export or screenshot the user list and roles before changing anything.
  2. Review document history. Find the first unexpected change and see which account made it.
  3. List access tokens. Check the repository’s API and access token settings for tokens nobody remembers creating. A token that was never meant to exist is a strong signal.
  4. List webhooks. A webhook sends a request to an outside URL when content changes. An unfamiliar webhook endpoint could be quietly collecting your content events.
  5. Compare deployed code with Git. Check your Git history for commits you did not make, and compare the live build against a fresh build from a known-good commit.
  6. Inspect dependencies. Look for packages you did not add, lockfile changes nobody reviewed, and install scripts that run during the build.
  7. Check hosting and DNS. Review who has access to your hosting account, your DNS records and your build settings.

View the page source of a live page and search it for script tags, iframes and external domains you do not recognise. Browser developer tools show every request a page makes, which makes injected third-party calls easy to spot. A Content Security Policy that lists allowed script sources makes this kind of injection harder, and the MDN guide to Content Security Policy explains how it works.

First steps to take

Act on the credentials first, then on the code. Changing passwords before you understand the entry point can still be worthwhile, but write down what you saw before you change it.

  • Remove unknown users and lower roles that are higher than needed. Ask every remaining user to reset their password and turn on any extra sign-in protection your account offers.
  • Revoke and recreate access tokens. Replace the values in your hosting provider’s environment variables, then redeploy so the old tokens stop working everywhere.
  • Delete unknown webhooks and recheck the ones you keep so they point only to endpoints you control.
  • Restore content. Revert tampered documents to a known-good version and republish. Remove spam documents rather than hiding them.
  • Rebuild from clean code. Reset your front-end branch to a trusted commit, reinstall dependencies from a reviewed lockfile and deploy a fresh build. Do not patch the live files by hand.
  • Rotate other secrets. Anything stored in the same build environment, such as API keys for analytics, email or payments, should be treated as exposed and replaced.
  • Secure the accounts around the site. This covers your Git provider, hosting account, domain registrar and DNS provider.

After the clean deploy, request a review in Search Console if you saw a security warning, and check that old spam URLs now return a proper not found response.

Reducing the chance of a repeat

Give each person the lowest role that lets them do their job, and remove access when someone leaves. Keep tokens out of your Git repository and out of code that runs in the browser. Use read-only access wherever your front end only needs to fetch published content. Review dependency updates before merging them, and keep the lockfile under version control. For a broader checklist of common web application weaknesses, the OWASP Top Ten is a useful reference, and Prismic’s own documentation covers repository roles, access tokens and webhooks in detail.

Frequently asked questions

Does a compromised Prismic account mean my front end is also compromised?

Not necessarily. A stolen editor login can change your content without touching your code. The reverse also holds: a tampered front end can leave your Prismic content untouched. Check both layers separately.

Can I tell who changed a document?

Prismic records document versions, and the level of history available can depend on your plan. Use it to find the first unexpected change and the account behind it. If you need more detail than the dashboard shows, check what your plan includes before you assume it is unavailable.

Should I take the site offline while I investigate?

It depends on what is being served. If visitors are being redirected, shown spam or exposed to malicious scripts, a maintenance page or a rollback to a known-good deploy is reasonable while you work. If the problem is limited to a few edited documents, you can usually fix it without downtime.

We use essential cookies to make this site work and remember your preferences. We do not use advertising or analytics cookies. Privacy Policy. Cookie Policy.