Case study · Product security

One login bug away: hardening single sign-on, staff access and integration keys for a UK B2B SaaS company

A UK software company sold a collaboration platform to enterprises, most of whom signed in through their own identity providers. Its engineers had built single sign-on support over years, one customer request at a time. Staff could open customer workspaces for support, and integrations held keys to code hosting and the CDN. When another SaaS company disclosed that a flaw in its SSO flow let an attacker pose as staff and reach production, the board asked whether the same chain existed here.

Case studyB2B software · United KingdomSumanta Mukhopadhyay9 min read
#security#platform#governance
CASE STUDY · CASE STUDY · PRODUCT SECURITY14 Nov 2026 · 15:50 GST
At a glance
SectorB2B software · United Kingdom
My roleFractional CTO and security architect
EngagementAssessment, architecture and delivery leadership
ScopeSSO and SAML/OIDC flows, staff and support access, session handling, integration credentials, secrets, detection, customer communication
What changed
  • 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
Central authentication serviceStrict SAML and OIDC validationSeparate staff identityJust-in-time support accessShort-lived integration tokensSecrets managerAudit logging and alertsIncident communication templates

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

Customers
Customer identity providersSAML and OIDC
Authentication
Central auth serviceone strict SSO implementationSession serviceshort sessions, bound to client
Staff
Separate staff identityphishing-resistant MFAJust-in-time support accessapproved, time-limited
Integrations
Code hosting appminimal permissionsCDN and DNSscoped, short-lived tokensSecrets managerno human read access
Evidence
Audit logAlertsCustomer notices
Customers and staff come in through different doors, and neither door leads to the keys.

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

  1. Sign inA customer user signs in through their identity provider
  2. ValidateThe central auth service strictly validates the assertion or token
  3. SessionA short session is issued for that tenant only
  4. SupportIf help is needed, a staff member requests time-limited access to that workspace
  5. ApproveA lead approves; the customer is told or consents where required
  6. RecordEvery action is logged; access expires automatically
Customer and staff paths never merge, and staff access always has a reason and an end.
Sequence diagram: a user request reaches the Kubernetes API server, which authenticates the user and checks permissions, then runs mutating and validating admission policies and webhooks before allowing or rejecting the request
Authenticate, authorise, then apply policy, on every request: the same layered checks the company applied to staff access to customer data. Source: Kubernetes documentation · CC BY 4.0

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

Engineering
  1. Central auth service
  2. Strict SSO validation
  3. Tenant-scoped sessions
Security
  1. Staff identity and keys
  2. Integration review
  3. Alerts and audit
Support
  1. Just-in-time access process
  2. Customer consent options
  3. New tooling adoption
Customer success and legal
  1. Code of Practice mapping
  2. Incident notice templates
  3. Answers for security reviews
Support had the biggest habit change: no more opening any workspace at will.
Phase 1Map
  • All login paths
  • Staff access routes
  • Integration permissions
Phase 2Separate
  • Staff identity
  • Just-in-time support
  • No human secret reads
Phase 3Consolidate
  • Central auth service
  • Strict validation
  • Migrate providers
Phase 4Prove
  • External test of SSO
  • Incident exercise
  • Customer evidence
Separating staff access came before consolidating SSO: it broke the most dangerous chain first.

Key decisions and trade-offs

DecisionAlternativeWhy
Separate staff identity providerStaff flag on customer accountsA customer-side flaw cannot create staff sessions
Just-in-time support accessStanding access to all workspacesLimits what a compromised staff account can see
One central auth serviceFix each SSO code pathOne place to test, review and harden
No human reads of production secretsRestrict to senior engineersRemoves the step from staff session to keys
Minimal integration permissionsKeep broad permissions for convenienceA compromised integration reaches less
Pre-written customer rotation noticeWrite it during an incidentFaster, 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.

References
  1. 1
  2. 2
  3. 3
  4. 4
    Software Security Code of PracticeUK Government · May 2025
  5. 5
  6. 6
FAQ

Common questions

Why is a SaaS company's SSO flow a high-value target?

Because a flaw there can let an attacker create sessions as any user, including staff with broad access. If staff sessions can reach integrations and keys, one login bug can lead to production, as GitBook's November 2026 incident showed.

How should support staff access customer accounts?

Through a separate staff identity with phishing-resistant MFA, using just-in-time access that is approved, time-limited, logged and, where customers require it, consented to, rather than standing access to every workspace.

What is the UK Software Security Code of Practice?

A voluntary code published by the UK government and NCSC in May 2025 setting baseline security principles for software vendors, including secure development, secure build environments and communicating with customers about incidents.

Keep reading

Related

Open to advisory, fractional CTO & select builds

Let's talk about what you're building.

The fastest route is a free 30-minute call. Prefer to write? Send a message and I'll reply personally within two business days.

Start a conversation

How would you like to reach me?

Book a 30-min callFastest. Pick any open slot on my calendar.→ Write in GmailOpens a pre-filled draft in your browser.→ Use my email appOutlook, Apple Mail or your default client.→

I reply personally within two business days. Time zones from the Americas and Europe to the Middle East and Asia-Pacific.