Create a new GitBook API token, rotate integration secrets and re-authenticate the GitBook MCP server

GitBook breach: attacker reached production secrets, all customer API tokens revoked · Security incident · Web · GitBook · Nov 3, 2026

What happened

GitBook says an attacker got into its systems on 2 November through a flaw in its SSO login flow, creating sessions that acted as GitBook staff. From there they read the credentials of a misconfigured GitHub App, reached internal code, then a Cloudflare API key and production secrets with full infrastructure access. GitBook took the app offline for about 16 hours, rotated every secret and revoked all personal API tokens. It treats all customer data as exposed, including API tokens, integration tokens and secrets, session signing secrets and docs behind authenticated access. The attack used AI agents and appears aimed at one customer; GitBook found no evidence other customers' content was changed.

How to prevent it

Give every tool you connect its own token with the smallest scope, keep a list of where each one lives, and rotate all of them the day a provider reports a breach.

Fix prompt for your own AI tool

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

I use GitBook and connect it to other tools. Help me respond to GitBook's November 2026 security incident: 1) List every place my projects use a GitBook API token (apps, CI secrets, scripts, .env files) so I can swap in a new one. 2) List the third-party tools and published integrations I connect to GitBook and tell me which secrets to rotate. 3) If I use GitBook authenticated access with my own backend, show me where the signing key lives in my code so I can regenerate it and update it. 4) Remind me to re-authenticate the GitBook MCP server in my AI tools. Don't change anything until I approve. Never ask me to paste tokens or .env contents; tell me where to check them myself.

Why this keeps happening: leaked secrets & api keys

Secret keys placed in front-end code, mobile bundles or public repositories can be found by automated scanners and abused, often running up large bills on AI or cloud accounts before anyone notices.

A quick checklist before you ship

More on this: every leaked secrets & api keys story and our related guide.

Tools involved

GitBook stories, MCP stories

Related stories

Source: original post on Web ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime. Weekly, every Friday.