How the attack works
GitLab enforces review through approval rules and approval settings. A rule defines how many approvals a merge request needs and who may give them, and a rule with zero required approvals is optional. The settings decide how the rules are applied. By default the creator of a merge request cannot approve it, while the users who add commits can unless that is prevented, approval rules can be overridden for a single merge request unless that is prevented, and approvals are removed when new commits are added. A setting that is configured for the instance locks it for all groups and projects, and a prevention setting that is enabled for a top-level group locks the project setting below it. Everything else is in the hands of project Maintainers and group Owners.
An attacker who holds one of these roles removes the second person from the process. They let the author approve, keep approvals when commits are pushed after the review, allow rules to be edited per merge request, or delete the rule itself, and then merge a change that nobody else looked at. GitLab records every one of these changes as its own audit event type: six for the group settings, five for the project settings, and update_approval_rules and approval_rule_deleted for the rules.
What an attacker needs
- The Maintainer or Owner role on the project for project settings and approval rules, or the Owner role on the group for the group settings.
- A setting that is not locked by the instance or by a prevention setting of the top-level group.
- Log collection: audit event streaming (Ultimate) for the top-level group or the instance, to an HTTP destination, received as JSON.
Impact
One account can write, approve and merge a change into a branch that pipelines build and deploy from. That is the step that turns access to a repository into code running in production or shipped to customers. A weakened group setting applies to every project that inherits it, and a change that is switched back after the merge leaves the settings page looking as it did before.
Detection rules
GitLab Merge Request Approval Rule Deleted or Updated
Detects a merge request approval rule of a project being deleted (approval_rule_deleted) or updated (update_approval_rules). An approval rule defines how many approvals a merge request needs and who may give them. GitLab states that a rule with zero required approvals is optional and that, when no default rule is defined, any user can approve a merge request. Deleting a rule or lowering its required approvals therefore removes the second person from the merge. The Maintainer or Owner role on the project is enough for both. The event type reference lists these events without their fields, so the rule cannot tell a lowered count from a raised one. Read the rules in the Merge requests settings of the project.
title: GitLab Merge Request Approval Rule Deleted or Updated
id: fcc07e88-7d3d-4602-904e-4acd26152bad
status: experimental
description: >-
Detects a merge request approval rule of a project being deleted
(approval_rule_deleted) or updated (update_approval_rules). An approval
rule defines how many approvals a merge request needs and who may give
them. GitLab states that a rule with zero required approvals is
optional and that, when no default rule is defined, any user can approve
a merge request. Deleting a rule or lowering its required approvals
therefore removes the second person from the merge. The Maintainer or
Owner role on the project is enough for both. The event type reference
lists these events without their fields, so the rule cannot tell a
lowered count from a raised one. Read the rules in the Merge requests
settings of the project.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/project/merge_requests/approvals/rules/
- https://attack.mitre.org/techniques/T1195/002/
author: Forestall
date: 2026-11-18
tags:
- attack.initial-access
- attack.t1195.002
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- approval_rule_deleted
- update_approval_rules
condition: selection
falsepositives:
- Maintainers who replace approvers when people change teams, or who raise the number of required approvals. Confirm with the team that owns the project.
level: medium
False positives
- Maintainers who replace approvers when people change teams, or who raise the number of required approvals. Confirm with the team that owns the project.
GitLab Group Merge Request Approval Setting Changed
Detects a change to the merge request approval settings of a group: prevent approval by the merge request creator (allow_author_approval_updated), prevent approvals by users who add commits (allow_committer_approval_updated), prevent editing approval rules in projects and merge requests (allow_overrides_to_approver_list_per_merge_request_updated), require the user's password for approvals (require_password_to_approve_updated), require new approvals when commits are added (retain_approvals_on_push_updated) and require reauthentication for approvals (require_reauthentication_to_approve_updated, which is also written for projects). A prevention setting that is enabled for a top-level group locks the project setting below it, so switching one off hands the decision back to every project Maintainer. The event type reference lists these events without their fields, so the rule matches on the event type and fires in both directions.
title: GitLab Group Merge Request Approval Setting Changed
id: 48d86a29-b6c4-4a76-b660-01593ce3e961
status: experimental
description: >-
Detects a change to the merge request approval settings of a group:
prevent approval by the merge request creator
(allow_author_approval_updated), prevent approvals by users who add
commits (allow_committer_approval_updated), prevent editing approval
rules in projects and merge requests
(allow_overrides_to_approver_list_per_merge_request_updated), require
the user's password for approvals (require_password_to_approve_updated),
require new approvals when commits are added
(retain_approvals_on_push_updated) and require reauthentication for
approvals (require_reauthentication_to_approve_updated, which is also
written for projects). A prevention setting that is enabled for a
top-level group locks the project setting below it, so switching one off
hands the decision back to every project Maintainer. The event type
reference lists these events without their fields, so the rule matches
on the event type and fires in both directions.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/project/merge_requests/approvals/settings/
- https://docs.gitlab.com/user/group/manage/
- https://attack.mitre.org/techniques/T1195/002/
author: Forestall
date: 2026-11-18
tags:
- attack.initial-access
- attack.t1195.002
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- allow_author_approval_updated
- allow_committer_approval_updated
- allow_overrides_to_approver_list_per_merge_request_updated
- require_password_to_approve_updated
- retain_approvals_on_push_updated
- require_reauthentication_to_approve_updated
condition: selection
falsepositives:
- A group Owner who tightens the settings writes the same events. Read the details of the event, or the Merge request approvals section of the group settings, for the value now in force.
- Planned changes to the review process of a group. They are rare and should match a change request.
level: medium
False positives
- A group Owner who tightens the settings writes the same events. Read the details of the event, or the Merge request approvals section of the group settings, for the value now in force.
- Planned changes to the review process of a group. They are rare and should match a change request.
GitLab Project Merge Request Approval Setting Changed
Detects a change to the merge request approval settings of a project: approval by the author (project_merge_requests_author_approval_updated), approval by committers (project_merge_requests_disable_committers_approval_updated), overriding approvers per merge request (project_disable_overriding_approvers_per_merge_request_updated), whether approvals are reset on a push (project_reset_approvals_on_push_updated) and requiring the user's password to approve (project_require_password_to_approve_updated). A project Maintainer can change these unless the group or the instance has locked them. Letting the author approve, or keeping approvals after new commits, lets one account merge a change that nobody else reviewed. The event type reference lists these events without their fields, so the rule matches on the event type and fires in both directions.
title: GitLab Project Merge Request Approval Setting Changed
id: 70b927ab-1f7e-439a-bc37-e2b1ebf56cc6
status: experimental
description: >-
Detects a change to the merge request approval settings of a project:
approval by the author (project_merge_requests_author_approval_updated),
approval by committers
(project_merge_requests_disable_committers_approval_updated), overriding
approvers per merge request
(project_disable_overriding_approvers_per_merge_request_updated),
whether approvals are reset on a push
(project_reset_approvals_on_push_updated) and requiring the user's
password to approve (project_require_password_to_approve_updated). A
project Maintainer can change these unless the group or the instance
has locked them. Letting the author approve, or keeping approvals after
new commits, lets one account merge a change that nobody else reviewed.
The event type reference lists these events without their fields, so
the rule matches on the event type and fires in both directions.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/project/merge_requests/approvals/settings/
- https://attack.mitre.org/techniques/T1195/002/
author: Forestall
date: 2026-11-18
tags:
- attack.initial-access
- attack.t1195.002
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- project_merge_requests_author_approval_updated
- project_merge_requests_disable_committers_approval_updated
- project_disable_overriding_approvers_per_merge_request_updated
- project_reset_approvals_on_push_updated
- project_require_password_to_approve_updated
condition: selection
falsepositives:
- A Maintainer who tightens the settings writes the same events. Read the details of the event, or the Merge requests settings of the project, for the value now in force.
- New projects whose owners set up their review process. Keep the rule for projects that deploy to production if it is too noisy.
level: medium
False positives
- A Maintainer who tightens the settings writes the same events. Read the details of the event, or the Merge requests settings of the project, for the value now in force.
- New projects whose owners set up their review process. Keep the rule for projects that deploy to production if it is too noisy.
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.
Approval setting or rule changed, merge request merged, setting changed back
A Maintainer who needs the control gone for one merge switches it off, merges and switches it back on. Each step is ordinary alone. The same account changing an approval setting or rule of a project, merging in that project shortly after and changing the same setting again is the pattern of a review that was skipped on purpose.
- An approval setting or rule changes in a project: one of the project approval event types,
approval_rule_deletedorupdate_approval_rules. Keepentity_path,author_id, the event type and the time. - Within the next 60 minutes a merge request is merged in the same project:
merge_request_merged(GitLab 17.5 and later) with the sameentity_path. - Look for a second event of the same type on the same project within 60 minutes after the merge, or
approval_rule_createdafter a deleted rule. - Alert on the first two steps when the
author_idis the same, and raise the priority when the third step is present.
Eventsproject_merge_requests_author_approval_updatedapproval_rule_deletedupdate_approval_rulesmerge_request_mergedapproval_rule_created
LimitsMaintainers who tidy up rules during normal work merge on the same day, so confirm the merge request itself. GitLab does not document which field of merge_request_merged names the person who merged, so check one event of your own. Both windows of 60 minutes are starting points.
Triage
- Identify who made the change (
author_name,author_id,ip_address), which setting (the event type) and where (entity_path). - Read the
detailsobject of the event for the old and the new value, and compare it with the Merge requests settings of the project or the group. The events are written in both directions, so a setting that was tightened needs no action. - For an approval rule, check in the project settings which rules remain and how many approvals they require.
- List the merge requests that were merged in the project after the change (
merge_request_merged, GitLab 17.5 and later) and check who approved them. - Check whether the same account changed the setting back afterwards, and whether it also touched protected branches or CI/CD variables.
Response
Once the attack is confirmed:
- Set the approval settings and rules back to their approved state, and lock them at the group or instance where you can.
- Review every merge request that was merged in the affected projects while the setting was weak, and revert changes that had no independent approval.
- Hold deployments and releases built from those merges until the review is finished.
- Take the Maintainer or Owner role from the account that made the change until it is explained, reset its credentials and revoke its tokens.
- Check the other projects of the group for the same change by the same account.
Mitigation
- Enable the prevention settings at the top-level group, or for the instance on GitLab Self-Managed, so that project Maintainers cannot change them.
- Enforce approvals with a merge request approval policy (Ultimate), which can require approvals and set the approval settings from a separate security policy project.
- Give the Maintainer role on projects that deploy to few people, and require Code Owner approval on protected branches.
- Require re-authentication to approve where an approval has the weight of a signature.
- Alert on every change of a group approval setting, and on approval rule changes in the projects that deploy.
Frequently asked questions
Do the events say whether a setting was weakened or tightened?
The event type reference lists the approval events without their fields, so the rules match on the event type and fire in both directions. Read the `details` object of the event, or the Merge requests settings of the project or group, for the value now in force. A change that enables a prevention setting is a hardening step.
Can a project Maintainer undo an approval setting of the group?
Not when the group has enabled it. GitLab documents that a prevention setting enabled for a top-level group locks the equivalent project setting, and that a setting configured for the instance locks it for all groups and projects. When the group leaves a prevention setting disabled, project Maintainers can configure it for their own project.
Why is deleting an approval rule enough to merge alone?
GitLab states that when no default approval rule is defined, any user can approve a merge request, and that a rule with zero required approvals is optional. Deleting the rule, or lowering its required approvals, removes the requirement that someone else approves. The Maintainer or Owner role on the project is enough to do both.
Has this been reported in a real attack?
No public incident report describes weakened GitLab approval settings at the audit event level. The page is built on what GitLab documents about the settings and on the general pattern of removing review controls before a malicious change is merged.
References
- MITRE ATT&CK T1195.002: Supply Chain Compromise, Compromise Software Supply Chain
- GitLab Docs: Merge request approval settings
- GitLab Docs: Merge request approval rules
- GitLab Docs: Manage groups (group merge request approval settings)
- GitLab Docs: Merge request approval policies
- GitLab Docs: Audit event types
- GitLab Docs: Audit event schema and examples