1. Resources
  2. Detection rules
  3. Automatic Email Forwarding to an External Address Enabled in Google Workspace

Automatic Email Forwarding to an External Address Enabled in Google Workspace detection rules

An attacker in a hijacked Google Workspace account turns on automatic forwarding to an address outside the organization, so that copies of incoming mail keep arriving after the password is reset.

Platform
Google Cloud
Severity
Medium
Log source
Google Cloud Audit Logs
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A signed-in session of the target account, in an organizational unit where users may forward mail to any address, which is the default.
Impact
A copy of every incoming message reaches the attacker for as long as the setting stays, including reset links that open further accounts.
Response
Remove the forwarding address and unknown filters, reset the password and sign-in cookies, and treat mail received since the event as disclosed.
Mitigation
Turn automatic forwarding off or limit it to internal addresses for the organizational units that do not need to forward mail outside.
API method
google.login.LoginService.emailForwardingOutOfDomain

How the attack works

Gmail lets a user forward incoming mail automatically to one other address. The user adds the forwarding address in the Gmail settings, the address receives a verification message, and after the link in it is opened the user can switch forwarding on. Whether users may do this is an Admin console setting. Google states that it is on by default and that an administrator can turn it off or limit it to internal addresses for an organizational unit.

For an attacker who has taken over a mailbox, forwarding is the cheapest way to keep reading it. They add an address they control, confirm it from their side and select it as the forwarding destination. From then on every new message is copied out, including replies to the fraud they may be running from the account and the password reset links other services send to it. Forwarding is a setting of the mailbox, not of a session, so it keeps working after the owner has changed the password and signed out everywhere.

The Login audit log records email_forwarding_out_of_domain when a user enables forwarding to an address outside the domain, and Google renders the event with the destination address. Organizations that share Workspace data with Google Cloud receive it in Cloud Audit Logs at organization level as a Data Access entry of login.googleapis.com, with the method name google.login.LoginService.emailForwardingOutOfDomain. Forwarding that an administrator sets up with routing settings or an email monitor is written to the Admin audit log and has its own page (Email Monitor or Mail Routing Created by an Admin in Google Workspace).

What an attacker needs

  • A signed-in session of the target account, for example after phishing or with a stolen password.
  • Automatic forwarding allowed for the user's organizational unit, to any address. This is the default.
  • A mailbox outside the organization that the attacker controls and can confirm the forwarding address from.

Impact

A copy of every incoming message reaches the attacker for as long as the setting stays. That covers business mail, invoices and payment conversations, and reset links or codes that other services send to the mailbox, which can open further accounts. Because the forwarding does not depend on the password, the usual first response to a hijacked account leaves it in place.

Detection rules

Email Forwarding to an Address Outside the Domain Enabled by a User in Google Workspace

Detects a user enabling automatic forwarding of their Gmail to an address outside the domain (Login audit event email_forwarding_out_of_domain, rendered as the actor "has enabled out of domain email forwarding to {email_forwarding_destination_address}"). An attacker in a hijacked account sets this up so that copies of incoming mail keep arriving after the owner has reset the password, because forwarding is a setting of the mailbox and not of a session. The account is in principalEmail. Google's reference shows the destination address in the message of the event and does not list it in a parameter table, so look for it among the event parameters in protoPayload.metadata. The reference does not say whether forwarding through a Gmail filter writes this event. Forwarding that an administrator configures is recorded in the Admin audit log and does not match. The entry reaches Cloud Audit Logs as a Data Access entry of login.googleapis.com at organization level only when Google Workspace data sharing with Google Cloud is enabled, and reaches the SIEM only when the organization-level Data Access logs are routed to it.

LevelMediumStatusExperimentalLog sourceGoogle Cloud Audit Logs
title: Email Forwarding to an Address Outside the Domain Enabled by a User in Google Workspace
id: 340eee39-9e7b-486b-ba39-2cac602f2768
status: experimental
description: >-
  Detects a user enabling automatic forwarding of their Gmail to an address
  outside the domain (Login audit event email_forwarding_out_of_domain,
  rendered as the actor "has enabled out of domain email forwarding to
  {email_forwarding_destination_address}"). An attacker in a hijacked
  account sets this up so that copies of incoming mail keep arriving after
  the owner has reset the password, because forwarding is a setting of the
  mailbox and not of a session. The account is in principalEmail. Google's
  reference shows the destination address in the message of the event and
  does not list it in a parameter table, so look for it among the event
  parameters in protoPayload.metadata. The reference does not say whether
  forwarding through a Gmail filter writes this event. Forwarding that an
  administrator configures is recorded in the Admin audit log and does not
  match. The entry reaches Cloud Audit Logs as a Data Access entry of
  login.googleapis.com at organization level only when Google Workspace
  data sharing with Google Cloud is enabled, and reaches the SIEM only when
  the organization-level Data Access logs are routed to it.
references:
  - https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
  - https://developers.google.com/workspace/admin/reports/v1/appendix/activity/login
  - https://knowledge.workspace.google.com/admin/gmail/let-users-automatically-forward-their-own-gmail-emails
  - https://attack.mitre.org/techniques/T1114/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.collection
  - attack.t1114.003
logsource:
  product: gcp
  service: gcp.audit
detection:
  selection:
    protoPayload.serviceName: login.googleapis.com
    protoPayload.methodName: google.login.LoginService.emailForwardingOutOfDomain
  condition: selection
falsepositives:
  - Users who forward their work mail to a private mailbox or to a colleague at a partner organization. Where policy allows this, expect regular events and judge each by its destination address. Where policy forbids it, turn automatic forwarding off or limit it to internal addresses, after which the event should not occur.
level: medium

False positives

  • Users who forward their work mail to a private mailbox or to a colleague at a partner organization. Where policy allows this, expect regular events and judge each by its destination address. Where policy forbids it, turn automatic forwarding off or limit it to internal addresses, after which the event should not occur.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Forwarding to the same external address enabled by several accounts

Detection hypothesisJoins two logs

A user who forwards to a private mailbox uses an address nobody else uses. An attacker who works through several hijacked accounts tends to reuse one collection mailbox or one domain. The same destination on different accounts within days is unlikely to be a coincidence.

  1. Collect the google.login.LoginService.emailForwardingOutOfDomain entries of login.googleapis.com over 7 days, with the account from authenticationInfo.principalEmail and the destination address from the event parameters in protoPayload.metadata.
  2. Group them by destination address, and a second time by the domain of the destination.
  3. Raise every destination that two or more accounts enabled.

Eventsgoogle.login.LoginService.emailForwardingOutOfDomain

LimitsA shared mailbox of a partner or a ticketing service that a whole team forwards to matches as well, and so do popular free mail domains when grouping by domain. Keep an allowlist for those. The 7 days are a starting point.

Forwarding enabled shortly after a sign-in from an address the account has not used

Detection hypothesisSequence of eventsNeeds a baseline

An attacker sets up forwarding from the session that the takeover gave them, while a user who forwards to a private mailbox does it from their usual devices and networks. Forwarding enabled within hours of a sign-in from an address the account has not used before ties the setting to the takeover, even when Google did not flag the sign-in.

  1. A google.login.LoginService.emailForwardingOutOfDomain entry of login.googleapis.com. Keep the account in authenticationInfo.principalEmail and, where the entry carries it, the address in requestMetadata.callerIp.
  2. Take the google.login.LoginService.loginSuccess entries of the same account in the 24 hours before it, with their requestMetadata.callerIp.
  3. Raise the forwarding when one of those sign-ins, or the forwarding entry itself, comes from an address the account did not sign in from in the 30 days before.

Eventsgoogle.login.LoginService.emailForwardingOutOfDomaingoogle.login.LoginService.loginSuccess

LimitsTravel, new home networks and mobile carriers give users new addresses, so compare networks or countries where you can. An attacker who works through a stolen session cookie or a proxy near the user looks familiar, and the sign-in that started the session can lie further back than 24 hours. The 24 hours and 30 days are starting points.

Triage

  • The account is in principalEmail. Read the destination in the event parameters in protoPayload.metadata, which Google names email_forwarding_destination_address in the message of the event.
  • Judge the destination. A personal address that carries the user's own name is common. A free mail address with no relation to the user, or a domain that imitates a partner or your own, is not.
  • Ask the user through a second channel whether they set it up.
  • Review the sign-ins of the account before the event (google.login.LoginService.loginSuccess and suspiciousLogin) for a device, network or country the user does not use. A sign-in that Google flagged shortly before the forwarding was enabled ties the two together.
  • Open the Gmail settings of the account and read the filters as well. Filters that forward, delete or archive certain messages often accompany the forwarding address.
  • Search the same log for other accounts that enabled forwarding to the same address or the same domain.

Response

Once the attack is confirmed:

  1. Remove the forwarding address in the Gmail settings of the account and delete filters the owner did not create.
  2. Reset the user's password and reset the sign-in cookies so that existing sessions end, then review the account's 2-Step Verification methods, recovery information and connected apps.
  3. Treat the mail received since the event as disclosed. Reset the credentials of other services whose reset links or codes arrived in that time, and warn the people in payment conversations that ran through the mailbox.
  4. Review the mail the account sent while it was under the attacker's control and tell the recipients which messages were not from the owner.
  5. Look for the same destination on other accounts, and consider limiting automatic forwarding to internal addresses for the affected organizational unit.

Mitigation

  • Turn automatic forwarding off for the organizational units that do not need it, or allow internal addresses only, in the End User Access settings of Gmail in the Admin console.
  • Enforce 2-Step Verification for every user, with security keys or passkeys for the people whose mail matters most, to make the account takeover harder in the first place.
  • Make the check of forwarding settings and filters a fixed step of every account recovery.
  • Share Workspace data with Google Cloud and route the organization-level audit logs to the SIEM, including the Data Access log that carries the Login audit events.

Frequently asked questions

Does resetting the user's password stop automatic forwarding in Gmail?

No. Forwarding is a setting of the mailbox and applies to every new message, whoever is signed in. It keeps working after a password reset and after the sign-in cookies are reset. It stops when the forwarding address is removed or forwarding is disabled in the Gmail settings of the account, which is why that check belongs in every account recovery.

Which log carries the event when a user enables forwarding to an external address?

The Login audit log, as the event `email_forwarding_out_of_domain`. With Google Workspace data sharing enabled it appears in Cloud Audit Logs at organization level as a Data Access entry of `login.googleapis.com`. A SIEM that receives only the organization's Admin Activity logs does not see it.

Can an organization prevent users from forwarding mail to external addresses?

Yes. In the Admin console, under the End User Access settings of Gmail, an administrator can clear the option that lets users forward incoming email automatically, or keep it and choose internal email addresses only. Google states that the option is on by default. The setting can differ by organizational unit.

Does the rule also see forwarding that is set up through a Gmail filter?

That is not documented. Google's reference describes the event as out of domain email forwarding enabled and gives no further conditions, so do not assume that a filter that forwards selected messages writes it. Read the filters of a suspect account directly. Forwarding configured by an administrator is recorded in the Admin audit log and is covered by a different page.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.