Responding to an administrator account takeover
In an administrator account takeover, someone other than the owner signs in to an account that controls part of an application: its code host, its hosting, its database or its own admin area. The password was taken by Phishing or reused from another breach, or the attacker holds a copied session. Once inside, they can add a way back in that survives a password change, for example a device of their own registered as a second factor.1 Recovery closes each of those ways in first, and only then turns to the audit logs to learn what was done with the account.
Secure the email address first
Password resets arrive by email, so the mailbox behind the account decides who can take it back. An email address that the attacker adds to a GitHub account can be used to force a password reset.2 In a Google account, correct the recovery phone number and the recovery email address at once, and remove any Gmail filters, labels and forwarding rules the owner did not create.3 Once the mailbox is safe, change the password of the affected account, and of every other site where the same password was used.3
If the attacker changed the sign-in settings
When the owner can no longer sign in, the way back is the provider's recovery process. Google sends such users to its account recovery page, for example when someone changed the password or the recovery phone number.3 A GitHub owner in the same position secures the linked email account and contacts GitHub Support, which may suspend the account during its review, remove the settings the attacker changed and send a password reset link that expires after 24 hours.2
End every session
A session opened before the password change can stay valid. An application should issue a new session identifier after every password change or permission change, and deleting a cookie in the browser does nothing to a stolen copy of it.4
On GitHub the list is under the profile picture, Settings, Sessions in the Access section, where each unknown web session has a Revoke session button.5 On Google it is Your devices, then Manage devices.3 For an admin user of an application built on Supabase, the sign-out call with the global scope revokes the refresh tokens of all that user's sessions:6
// Supabase JS: global is the default in JavaScript, Swift, Python and C#
await supabase.auth.signOut({ scope: 'global' })
// Dart and Kotlin default to 'local'; pass the global scope there:
// await supabase.auth.signOut(scope: SignOutScope.global);The access tokens of those sessions remain valid until the expiry time in their exp claim, so the user is not signed out at the moment of the call.6
Check second factors and registered devices
An attacker who passed a two-factor check once can enrol a device of their own and produce valid codes from then on.1 Remove every authenticator, phone and security key the owner does not recognise. Revoking a GitHub Mobile session also removes that phone as a second factor.5 A passkey resists phishing, and GitHub recommends adding one.2
Revoke tokens, keys and app grants
After a suspected compromise of a GitHub account, go through its SSH keys, deploy keys, authorized OAuth apps and GitHub Apps, the repository webhooks (one could forward every push to the attacker), recent commits and the collaborators of each repository. The settings can revoke all authorizations or delete all credentials at once.2 To replace an API key, see Responding to a leaked API key; for tokens nobody uses any more, see Orphaned access tokens and OAuth grants.
Find out what happened
The GitHub security log, under Settings, Security log in the Archives section, lists the actions of the last 90 days. Entry names join a category and an operation, as in repo.create; the categories two_factor_authentication, public_key, oauth_authorization and user record changes to two-factor settings, SSH keys, app authorizations and the account itself, and the log exports as JSON or CSV.7 Check as well that no private repository was made public and none was transferred.2
Supabase records the dashboard and Platform API actions of organisation members, with the time, actor, IP address, email, token type, action and target. These Platform Audit Logs need the Team or Enterprise plan; every user account can see its own Account Audit logs, and authentication activity inside a project is in the separate Auth Audit Logs.8 At Google, the Recent security events panel under Security & sign-in has a No, it wasn't me answer for each event.3
Notable incident
On 27 August 2023 an employee of Retool, a software company, signed in on a fake login page, with a form for a one-time code, linked from a text message. A caller using a deepfaked voice then obtained one more code, which let the attacker add their own device to the employee's Okta account. The employee's Google Authenticator codes were synced to the Google account, so taking that account gave the attacker the other codes as well, and with them the VPN and Retool's internal admin systems. From there the attacker changed the email addresses and reset the passwords of 27 cloud customer accounts in the cryptocurrency industry.910 Retool revoked all internal employee sessions in Okta and GSuite, locked the affected accounts and restored their original email addresses.9
Prevent a repeat
Retool's write-up recommends FIDO2 hardware keys, with which "there isn't a code to share", so a caller like the one in its case has nothing to ask for.9 A multi-factor system can also refuse to accept a new device for an account that has been inactive.1 Require two-factor sign-in for every member of each provider account (Multi-factor authentication) and limit what each admin can reach (Principle of least privilege).
In SecFlash
SecFlash reports a Cloudflare account member who signs in with a password alone as SF-CLD-313, and a Supabase member without multi-factor sign-in as SF-CLD-529, both on the Cloud page. Cloudflare API tokens unused for 90 days, or over a year old with no end date, appear as SF-CLD-314 on the same page.
See also
- Session hijacking
- Phishing
- Credential stuffing
- Multi-factor authentication
- Session management
- Rogue administrator account
- Responding to a leaked API key
- Responding to an unrecognised server login
- Category: Incident response
References
- a b c MITRE (version 1.4, 4 November 2026). "Account Manipulation: Device Registration, T1098.005". MITRE ATT&CK.
- a b c d e "Preventing unauthorized access". GitHub Docs. GitHub.
- a b c d e "Secure a hacked or compromised Google Account". Google Account Help. Google.
- back "Session Management Cheat Sheet". OWASP Cheat Sheet Series. OWASP Foundation.
- a b "Viewing and managing your sessions". GitHub Docs. GitHub.
- a b "Signing out". Supabase Docs. Supabase.
- back "Reviewing your security log". GitHub Docs. GitHub.
- back Supabase (updated 18 November 2026). "Platform Audit Logs". Supabase Docs.
- a b c Retool (September 2023). "When MFA isn't MFA, or how we got phished". Retool blog.
- back Gatlan, Sergiu (15 September 2023). "Retool blames breach on Google Authenticator MFA cloud sync feature". BleepingComputer.
External links
- Viewing and managing your sessions, GitHub Docs
- Signing out, Supabase Docs