How the attack works
The email addresses of a GitLab account decide who can reset its password. A user can add secondary email addresses to the profile, and GitLab states that secondary addresses can be used to reset passwords but not to authenticate. The primary address is the one used to sign in, and when it is changed the former primary address stays on the account as a secondary one. Administrators of GitLab Self-Managed and GitLab Dedicated can also set a user's password directly, in the Admin area, with a Rake task or through the Users API.
For an attacker these are the two ways to turn brief access into lasting control. With a stolen session they add an address of their own, verify it, and reset the password whenever they need the account again. With administrator access they change the address or the password of another user. GitLab records the changes as email_created, user_email_address_updated, user_email_changed_and_user_signed_in, user_password_updated and password_reset_requested. The password reset flow has also been the target directly: in January 2024 GitLab fixed CVE-2023-7028, a flaw in versions 16.1 to 16.7.1 through which password reset emails could be delivered to an unverified email address.
What an attacker needs
- A session on the account, to add or change an email address, or administrator access, to change the address or password of another user.
- An account that signs in with a password. In its advisory for CVE-2023-7028 GitLab notes that accounts with two-factor authentication could have their password reset but not be taken over, because the second factor is still required to sign in.
- Log collection: audit event streaming (Ultimate) to an HTTP destination, received as JSON. The events have the User scope, and from GitLab 19.2 the email and password update events also have the Group scope for enterprise users.
Impact
Whoever controls a verified address of the account can set a new password and sign in as the user wherever no second factor is required. The owner is locked out when the password changes, and the attacker inherits every project, group and token page the account can reach. An added secondary address is easy to overlook, so the access can return long after the first incident was closed.
Detection rules
GitLab User Email Address Added or Changed
Detects an email address being created for a user (email_created), a user's email address being updated (user_email_address_updated) and the event user_email_changed_and_user_signed_in, for which the reference gives no more than the description "User email changed and user signed in". GitLab states that secondary email addresses can be used to reset passwords, so an address under an attacker's control is a way back into the account. The event type reference lists these events without their fields, so the rule matches on the event type and does not see the new address or its domain. Read the addresses on the Emails page of the profile or in the Admin area. From GitLab 19.2 the update event also has the Group scope for enterprise users.
title: GitLab User Email Address Added or Changed
id: 9cb8d39e-0a69-49aa-8d0b-6fc5cc49a784
status: experimental
description: >-
Detects an email address being created for a user (email_created), a
user's email address being updated (user_email_address_updated) and the
event user_email_changed_and_user_signed_in, for which the reference
gives no more than the description "User email changed and user signed
in". GitLab states that secondary email addresses can be used to reset
passwords, so an address under an attacker's control is a way back into
the account. The event type reference lists these events without their
fields, so the rule matches on the event type and does not see the new
address or its domain. Read the addresses on the Emails page of the
profile or in the Admin area. From GitLab 19.2 the update event also has
the Group scope for enterprise users.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/profile/
- https://docs.gitlab.com/user/profile/user_passwords/
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- email_created
- user_email_address_updated
- user_email_changed_and_user_signed_in
condition: selection
falsepositives:
- Users who add a second address or move to a new mailbox, and provisioning that updates addresses from the identity provider. Exclude the provisioning account by author_id, and look first at administrators and group Owners.
level: medium
False positives
- Users who add a second address or move to a new mailbox, and provisioning that updates addresses from the identity provider. Exclude the provisioning account by author_id, and look first at administrators and group Owners.
GitLab User Password Updated or Password Reset Requested
Detects a user's password being updated (user_password_updated) and a user requesting a password reset using a registered email address (password_reset_requested). A password can be changed by its owner, through the reset email, or by an administrator in the Admin area or through the API. A reset can be requested by anyone who knows an email address of the account. Both events are routine, and the reference lists them without their fields, so this is a low-level signal. It matters in sequence with a new email address on the same account, and when the author of a password update is not the user whose password changed. From GitLab 19.2 the update event also has the Group scope for enterprise users.
title: GitLab User Password Updated or Password Reset Requested
id: f936671e-af65-4ef8-bf15-ce2e3bc7b3fb
status: experimental
description: >-
Detects a user's password being updated (user_password_updated) and a
user requesting a password reset using a registered email address
(password_reset_requested). A password can be changed by its owner,
through the reset email, or by an administrator in the Admin area or
through the API. A reset can be requested by anyone who knows an email
address of the account. Both events are routine, and the reference lists
them without their fields, so this is a low-level signal. It matters in
sequence with a new email address on the same account, and when the
author of a password update is not the user whose password changed.
From GitLab 19.2 the update event also has the Group scope for
enterprise users.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/profile/user_passwords/
- https://docs.gitlab.com/security/reset_user_password/
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- user_password_updated
- password_reset_requested
condition: selection
falsepositives:
- Users who change or forget their password, which is the usual cause. Use the rule as context for other alerts on the same account, or keep it for administrators and group Owners.
- Help desk administrators who set a password for a user. These should match a ticket.
level: low
False positives
- Users who change or forget their password, which is the usual cause. Use the rule as context for other alerts on the same account, or keep it for administrators and group Owners.
- Help desk administrators who set a password for a user. These should match a ticket.
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.
Email address added and password reset soon after on the same account
A secondary email address can receive password reset emails. An account that gains a new address and then sees a password reset request and a password update within a short time shows the takeover path being used, which none of the three events shows alone.
- An address is added or changed: the audit event type
email_createdoruser_email_address_updated. Keep the account (entity_path), the author (author_id) and the address the change came from (ip_address). - Within the next 7 days a reset is requested for the same account:
password_reset_requested. - The password is then updated:
user_password_updatedfor the same account. - Raise the priority when a sign-in from an unseen address follows:
user_signed_in_from_unseen_ip(GitLab 19.0 and later).
Eventsemail_createduser_email_address_updatedpassword_reset_requesteduser_password_updateduser_signed_in_from_unseen_ip
LimitsA user who moves to a new mailbox and forgot the password produces the same sequence. GitLab does not document per event type which field names the account, so confirm on test events that entity_path matches across them. An attacker can wait longer than the 7 days, which are a starting point.
Password or email address of a user changed by another account
Users change their own password and addresses. A change in which the acting account is not the account that was changed comes from an administrator or from automation, and outside a known help desk process it is the trace of a compromised administrator account taking over a user.
- Keep a list of the accounts that are allowed to reset passwords and change addresses for others, such as help desk administrators and your provisioning service.
- Take the events
user_password_updatedanduser_email_address_updated, and compareauthor_id, the user who triggered the event, withtarget_id, the target of the event. - Alert when the two differ and the author is not on your list.
Eventsuser_password_updateduser_email_address_updated
LimitsThe schema defines author_id and target_id in general terms and does not say what the target of these two event types is, so check one self-service change and one administrator change of your own first. Provisioning through SCIM or LDAP may update addresses under a system account, which belongs on the list.
Triage
- Identify whose account was changed (
entity_path,target_details) and who made the change (author_name,author_id,ip_address). A change made by another account points to an administrator or to automation. - Open the Emails page of the user's profile, or the user in the Admin area, and read the addresses now on the account. An address in a domain that is not yours needs an explanation.
- Ask the user through a channel other than email whether they added the address or changed the password. GitLab sends security emails for both, so the user may already know.
- Check how the account signed in before the change, and whether GitLab reported an unseen address (
user_signed_in_from_unseen_ip). - Look at what followed on the account, such as a password reset request, a disabled second factor, new access tokens or new SSH keys.
Response
Once the attack is confirmed:
- Remove every email address the owner does not recognise from the account, and set the primary address back to the right one.
- Reset the password and the second factor of the account, and revoke its active sessions.
- Revoke the access tokens and delete the SSH keys that were added to the account since the first unexplained change.
- If an administrator account made the change, treat that account as compromised and review every other user it changed.
- Review what the account did while it was out of the owner's control, and rotate the credentials it could read.
Mitigation
- Enforce two-factor authentication for all users. An attacker who resets the password then still lacks the second factor, a point GitLab made in its advisory for CVE-2023-7028.
- Sign in through an identity provider and disable password authentication in the sign-in restrictions, which also disables the password reset.
- Keep administrator access to few dedicated accounts, because an administrator can set any user's password.
- Keep the instance on a supported patch level, and tell users to report security emails about addresses or passwords they did not change.
- Stream audit events to your SIEM and alert on new email addresses for privileged accounts.
Frequently asked questions
Can a secondary email address be used to reset the password of a GitLab account?
Yes. GitLab's profile documentation says that secondary email addresses can be used to reset passwords but not to authenticate, and the password documentation adds that GitLab sends the reset email when the address is verified and associated with an existing account. Only the primary address can be used to sign in afterwards. A verified secondary address under an attacker's control is therefore a standing way back into the account.
What was CVE-2023-7028, and do these rules detect it?
GitLab fixed it on 11 January 2024. In versions 16.1 to 16.7.1, password reset emails could be delivered to an unverified email address, and accounts with two-factor authentication could have the password reset but not be taken over. GitLab said it had not detected abuse on the platforms it manages and told self-managed customers to search `audit_json.log` and `production_json.log` for reset requests with several addresses. The rules here read streamed event types, not those log files, so they show reset requests and password changes but not the list of recipients.
Is the user told when an address is added or the password changes?
Yes. GitLab lists security emails for a changed email address, for a new email address, which goes to the new and to the primary address, and for a changed password, including a change made by an administrator. Such an email helps only while the owner still reads the mailbox it goes to, so the audit events remain the record that the security team can rely on.
Why are password events only a low-level signal?
Anyone who knows an email address can request a password reset for it, and users change and reset passwords all the time. `password_reset_requested` and `user_password_updated` therefore say little on their own. They become meaningful in sequence, for example a new email address followed by a reset request and a password update on the same account, which the detection logic on this page describes.
References
- MITRE ATT&CK T1098: Account Manipulation
- GitLab Docs: Audit event types
- GitLab Docs: Audit event schema and examples
- GitLab Docs: User account (add emails to your user profile, change your primary email)
- GitLab Docs: User passwords
- GitLab Docs: Reset user passwords
- GitLab Docs: Notification emails
- GitLab: Critical Security Release 16.7.2, 16.6.4, 16.5.6 (CVE-2023-7028, 11 January 2024)