- One audited authentication service instead of several SSO code paths
- Staff access separated from customer sign-in, with approval and expiry
- Integration credentials narrowed and short-lived, removing direct routes to production
- Alerts on unusual staff sessions and token use
- A clear way to tell customers what to rotate if an incident happens
Anonymised composite. Client names, identifying details and confidential figures are withheld; public facts are cited in the references.
The situation
A UK software company sold a collaboration and documentation platform to mid-sized and large organisations. Most enterprise customers signed in through their own identity providers using SAML or OIDC, and the company had added support for each provider's quirks over several years, in more than one part of the codebase. Support engineers could open any customer workspace to troubleshoot, using the same login system as customers with an internal flag. Integrations with code hosting, the CDN and DNS used long-lived keys, some readable from internal tools staff could reach.
Why now. In November 2026, GitBook disclosed that an attacker used a flaw in its SSO login flow to create sessions as staff, then reached a misconfigured code-hosting integration, internal repositories and a CDN API key that gave production access12. The same week, Apify confirmed that sign-in tokens and two-factor recovery codes had been accessed in an attack3. The UK's voluntary Software Security Code of Practice, published by the government and NCSC, sets expectations for vendors on secure development and on telling customers about incidents45, and enterprise customers had begun asking about it in security reviews.
What had to be true
- One way in: a single, well-tested authentication path for all SSO, not several.
- Staff are different: staff access never shares the customer login path.
- No standing access: support access is granted per case, time-limited and logged.
- No chains: a staff session cannot reach keys that reach production.
- Visible: unusual sessions and token use raise alerts.
- Explainable: if something happens, customers are told quickly what to rotate.
Architecture
All SSO handling moved into one authentication service built on maintained SAML and OIDC libraries, configured strictly: signatures required on assertions, audience and recipient checked, replay prevented and clock skew limited. Provider-specific workarounds became configuration in one place rather than code scattered across the product. Staff signed in through a separate identity provider with hardware security keys; a customer's SSO configuration could never create a staff session.
The data flow, end to end
- Sign inA customer user signs in through their identity provider
- ValidateThe central auth service strictly validates the assertion or token
- SessionA short session is issued for that tenant only
- SupportIf help is needed, a staff member requests time-limited access to that workspace
- ApproveA lead approves; the customer is told or consents where required
- RecordEvery action is logged; access expires automatically

The hard part: breaking the chain from login to production
Assume the login will be bypassed one day. SSO protocols are intricate and implementation bugs recur across the industry. The design question was therefore not only "is our SSO correct?" but "what can an attacker do with a forged session?". For customer sessions, the answer became: one tenant's data, nothing else. For staff sessions, it became: nothing, until access to a specific workspace is approved, and never the integration keys. The model borrowed from how Kubernetes treats every API request: authenticate, authorise, then apply policy before anything is allowed6.
Integrations with too much reach. The code-hosting integration had been installed with broad permissions years earlier, and CDN and DNS keys could change production routing. Each integration was reinstalled with the minimum permissions it needed, CDN and DNS changes moved to the deployment pipeline with short-lived tokens, and the secrets manager stopped allowing humans to read production secrets at all; only workloads could.
Rotation customers can actually do. GitBook's response asked customers to create new API tokens, rotate integration secrets and review recent changes made by its app1. The company wrote its own version of that notice in advance, listing exactly what customers would need to rotate, and built a one-click way for administrators to revoke all tokens for their workspace.
Every SaaS login flow will have a bug one day. What matters is that a forged session leads nowhere valuable: one tenant at most, never the staff console, never the keys.
How it ran
- Central auth service
- Strict SSO validation
- Tenant-scoped sessions
- Staff identity and keys
- Integration review
- Alerts and audit
- Just-in-time access process
- Customer consent options
- New tooling adoption
- Code of Practice mapping
- Incident notice templates
- Answers for security reviews
- All login paths
- Staff access routes
- Integration permissions
- Staff identity
- Just-in-time support
- No human secret reads
- Central auth service
- Strict validation
- Migrate providers
- External test of SSO
- Incident exercise
- Customer evidence
Key decisions and trade-offs
| Decision | Alternative | Why |
|---|---|---|
| Separate staff identity provider | Staff flag on customer accounts | A customer-side flaw cannot create staff sessions |
| Just-in-time support access | Standing access to all workspaces | Limits what a compromised staff account can see |
| One central auth service | Fix each SSO code path | One place to test, review and harden |
| No human reads of production secrets | Restrict to senior engineers | Removes the step from staff session to keys |
| Minimal integration permissions | Keep broad permissions for convenience | A compromised integration reaches less |
| Pre-written customer rotation notice | Write it during an incident | Faster, clearer communication when it matters |
What I'd do again, and differently
Again: separate staff access first; it removed the worst-case chain within weeks. Differently: commission an external test of the SSO implementation earlier; it found edge cases in provider-specific handling that internal reviews had missed. Related: the 14 November tech news, the machine identity case study, the multi-tenant SaaS case study and the UK page.
If one login bug could take an attacker from your sign-in page to production, see my fractional CTO work, or analyse your challenge and bring the result to a call.
- 1GitBook security incident, November 2026GitBook · Nov 2026
- 2
- 3Apify Confirms Customer Data Accessed in CyberattackSecurityWeek · 13 Nov 2026
- 4Software Security Code of PracticeUK Government · May 2025
- 5Software Security Code of Practice: overviewNCSC · 2025
- 6admission-control-phases.svg (Kubernetes documentation images)Kubernetes · 2026