How the attack works
A webhook tells GitHub to send an HTTP request with data about an event to a URL whenever that event happens. Webhooks exist for a repository, for an organization and, as global webhooks, for an enterprise. An organization webhook can subscribe to events in all repositories the organization owns and to events at organization level, such as a new member. Teams use webhooks to trigger external build servers, to notify chat tools and to log events for audit purposes.
The same mechanism gives an attacker a standing feed. A person who is a repository owner or has admin access to a repository can create and edit its webhooks, and an organization owner can do so for the organization. A new webhook that points to an outside server, or an existing webhook whose payload URL or event list was changed, delivers the payloads of pushes, pull requests, issues and membership changes for as long as it stays active, without any further sign-in by the attacker. GitHub records the creation as hook.create, a change of the configuration as hook.config_changed, a change of the subscribed events as hook.events_changed and a change of the active state as hook.active_changed. The documented fields of these actions name the webhook in hook_id and its events in events. They do not include the payload URL, so the destination has to be read from the webhook settings.
What an attacker needs
- A repository owner or admin access to the repository for a repository webhook.
- An organization owner for an organization webhook.
- An enterprise owner for a global webhook.
- A server that is reachable from GitHub to receive the deliveries.
Impact
GitHub pushes event payloads to the attacker's server in near real time. Depending on the subscribed events these describe commits and branches, the text of pull requests and issues, new members and teams, and changes of repository settings. The feed keeps running after the attacker's session or token is gone, because the webhook belongs to the repository or organization, and it tells the attacker when defenders start to change things. A webhook that already feeds a build server can also be redirected, which takes the events away from the system that was meant to receive them.
Detection rules
GitHub Webhook Configuration, Events or Active State Changed
Detects a change to an existing webhook. hook.config_changed is written when the configuration of a hook is changed, hook.events_changed when its subscribed events are changed and hook.active_changed when its active status is updated. Editing a webhook can send its deliveries to another server, add events to what it receives, or switch on a webhook that had been inactive. The events_changed event carries the new and the previous event list in events and events_were, and active_changed carries active and active_was. The documented fields do not include the payload URL.
title: GitHub Webhook Configuration, Events or Active State Changed
id: 2269a499-7b18-441d-bcac-72c5cca8a0d8
status: experimental
description: >-
Detects a change to an existing webhook. hook.config_changed is written
when the configuration of a hook is changed, hook.events_changed when its
subscribed events are changed and hook.active_changed when its active
status is updated. Editing a webhook can send its deliveries to another
server, add events to what it receives, or switch on a webhook that had
been inactive. The events_changed event carries the new and the previous
event list in events and events_were, and active_changed carries active
and active_was. The documented fields do not include the payload URL.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/webhooks/using-webhooks/editing-webhooks
- https://attack.mitre.org/techniques/T1567/004/
author: Forestall
date: 2026-11-18
tags:
- attack.exfiltration
- attack.t1567.004
logsource:
product: github
service: audit
detection:
selection:
action:
- hook.config_changed
- hook.events_changed
- hook.active_changed
condition: selection
falsepositives:
- Integration owners who move a receiver to a new address, rotate the webhook secret or add an event for a new feature. Confirm the change with the owner of the webhook.
- A webhook that is switched off for maintenance and on again. The active state change is the least telling of the three actions.
level: medium
False positives
- Integration owners who move a receiver to a new address, rotate the webhook secret or add an event for a new feature. Confirm the change with the owner of the webhook.
- A webhook that is switched off for maintenance and on again. The active state change is the least telling of the three actions.
GitHub Webhook Created
Detects a new webhook being added (hook.create, which GitHub describes as a new hook that was added). A webhook makes GitHub send the payload of every subscribed event to a URL, so a webhook that points to a server outside the organization is a standing copy of repository or organization activity. Only a repository owner, a user with admin access to the repository or an organization owner can create one. The event names the webhook in hook_id and its events in events. The documented fields do not include the payload URL, which has to be read from the webhook settings.
title: GitHub Webhook Created
id: 5ed6dac2-7605-4730-9f39-fe060c13c4aa
status: experimental
description: >-
Detects a new webhook being added (hook.create, which GitHub describes as
a new hook that was added). A webhook makes GitHub send the payload of
every subscribed event to a URL, so a webhook that points to a server
outside the organization is a standing copy of repository or organization
activity. Only a repository owner, a user with admin access to the
repository or an organization owner can create one. The event names the
webhook in hook_id and its events in events. The documented fields do not
include the payload URL, which has to be read from the webhook settings.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/webhooks/using-webhooks/creating-webhooks
- https://attack.mitre.org/techniques/T1567/004/
author: Forestall
date: 2026-11-18
tags:
- attack.exfiltration
- attack.t1567.004
logsource:
product: github
service: audit
detection:
selection:
action: hook.create
condition: selection
falsepositives:
- Teams that connect a build server, a chat tool or an issue tracker, which is the usual cause. Confirm the payload URL in the webhook settings and keep a list of the destinations you expect.
- Infrastructure-as-code tools that create webhooks for new repositories. Exclude the service identity they use by actor.
level: medium
False positives
- Teams that connect a build server, a chat tool or an issue tracker, which is the usual cause. Confirm the payload URL in the webhook settings and keep a list of the destinations you expect.
- Infrastructure-as-code tools that create webhooks for new repositories. Exclude the service identity they use by actor.
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.
Existing webhook subscribed to more events than before
A webhook that already exists draws less attention than a new one. An attacker who can edit it adds events to its subscription, so the receiver starts to get pushes, pull requests or membership changes it did not get before. The change event carries the old and the new event list, and the difference between the two is the signal.
- A webhook's events change:
hook.events_changed. Takehook_id,repoororgandactor. - Compare the list in
eventswith the list inevents_wereof the same event. - Alert when
eventsholds entries thatevents_weredid not hold, and name the added events in the alert.
Eventshook.events_changed
LimitsIntegrations that are extended with a new feature add events as well, so the result needs the owner of the webhook. GitHub lists both fields without describing their format. Its export example shows them as lists of webhook event names, which you should confirm on your own events.
Webhook created or changed by an account that received admin access shortly before
Only admin access to a repository or the owner role in an organization allows webhook changes. An account that is granted that access and creates or edits a webhook soon afterwards used the new right for a purpose that is rare in daily work.
- Access is granted:
repo.add_memberorrepo.update_memberfor a repository,org.update_memberfor the owner role. The fieldusernames the account that received it, withrepoororg. - Within 24 hours the same account, now in
actor, writeshook.create,hook.config_changedorhook.events_changedin the same repository or organization. - Alert on the pair and attach the account that granted the access, which is
actorof the first event.
Eventsrepo.add_memberrepo.update_memberorg.update_memberhook.createhook.config_changedhook.events_changed
LimitsA new maintainer who sets up an integration on the first day matches as well. Access that arrives through a team is recorded by other actions and is not covered. The 24 hours are a starting point.
Triage
- Identify who made the change (
actor), the repository or organization (repo,org) and the webhook (hook_id). - Open the webhook in the settings of the repository or organization and read its payload URL. The documented fields of the audit event do not include the URL.
- Read which events the webhook receives (
events). Forhook.events_changedcompareeventswithevents_were, and forhook.active_changedcompareactivewithactive_was. - Check whether the event names an app (
integration,oauth_application). A webhook created by an integration that the organization installed on purpose is expected. - Check whether a token made the change (
programmatic_access_type,hashed_token) and whether the account was given admin access or the owner role shortly before.
Response
Once the attack is confirmed:
- Delete the webhook, or set its payload URL and events back to the previous values when an existing webhook was changed.
- Treat everything the webhook could deliver since the change as disclosed. Before deleting the webhook, review its deliveries in its settings and list the events that were sent. GitHub shows the deliveries of the past 3 days with the payload it sent.
- Secure the account that made the change. Revoke the token it used, or reset the credentials and end the sessions of a person's account, and remove admin access it should not have.
- Review all other webhooks, deploy keys and app installations of the same repository or organization, because admin access manages those as well.
- Change the webhook secret of an integration whose webhook was edited, since the editor could set a new one.
Mitigation
- Keep an inventory of the webhooks of every organization and repository with their payload URLs and owners, and review it on a schedule.
- Keep repository admin access and the organization owner role to the people who need them, because these are the only roles that can manage webhooks.
- Follow GitHub's guidance to subscribe each webhook to the minimum number of events, so that an existing webhook has little to offer when it is redirected.
- Stream the audit log to a SIEM and alert on every new webhook and every changed webhook.
Frequently asked questions
Does the audit log show where a webhook sends its data?
Not in the fields GitHub documents for these actions. The event reference lists `hook_id`, `events`, `events_were`, `active` and `name` for the `hook` actions and no field for the payload URL. To see the destination, open the webhook in the settings of the repository or organization, where the payload URL and the recent deliveries are shown.
Who can create a webhook in GitHub?
GitHub states that you must be a repository owner or have admin access in the repository to create and manage its webhooks, and an organization owner for organization webhooks. Enterprise owners can create global webhooks. Write access to a repository is not enough.
Does a webhook receive source code?
A webhook delivers data about events, not a copy of the repository. The payload of each subscribed event describes what happened, for example a push, a pull request or a new member. That is still a continuous view of the work in a private repository, and it reaches the receiver without any credential that could be revoked later.
Is there an incident report that shows this step in an audit log?
No public incident report describes a malicious GitHub webhook at the audit event level. MITRE ATT&CK lists the technique as Exfiltration Over Webhook and names GitHub among the services that can post data to a webhook endpoint. The page is built on what GitHub documents webhooks to do.