Security model
GitNotify sits between GitHub and your chat, so it is built to trust nothing it hasn't verified, to ask for as little access as it can, and to keep secrets sealed. This page describes how.
Nothing is trusted before it verifies
Section titled “Nothing is trusted before it verifies”Every request is verified over its raw body before GitNotify parses it:
| Source | Check |
|---|---|
| GitHub | the X-Hub-Signature-256 HMAC-SHA256 signature with the app's webhook secret. Bodies over 1 MB are refused |
| Discord | the Ed25519 signature with the application's public key. Requests more than 5 minutes old are refused |
| Slack | the X-Slack-Signature HMAC-SHA256 signature with the signing secret. Timestamps more than 5 minutes away are refused |
| Telegram | Telegram signs nothing, so the webhook is registered with a secret and every update must send it back in the X-Telegram-Bot-Api-Secret-Token header. It is compared in constant time before anything is read, and a missing or wrong one gets a 401. Bodies over 64 KB are refused |
Commands, button presses and lifecycle events from chat platforms are all verified this way. A forged request is answered with an error and changes nothing.
A repository reaches a chat only through proof
Section titled “A repository reaches a chat only through proof”Installing the GitHub App is not enough for a repository to appear in someone's chat. A person has to prove two things at once:
- that they administer the chat: Manage Server in Discord, workspace admin or owner (or the installer) in Slack, creator or administrator in a Telegram group
- that they are an admin of the repository on GitHub, through a GitHub sign-in
The sign-in link works once, lasts 10 minutes and is bound to the chat and the person, and in Discord and Slack to the browser. The installation id GitHub adds to setup links is never trusted on its own. Routes are keyed by the numeric installation id and repository id, and an event for a repository with no route is acknowledged and dropped. See The GitHub App.
Least privilege
Section titled “Least privilege”- GitHub: read-only access to pull requests and Actions. GitNotify holds no private key for the app, so it never acts on your repositories.
- Discord: permissions
805391376, never Administrator, and no gateway connection. - Slack: six bot scopes, none of which reads messages, and no user token.
- Telegram: privacy mode on, and only three kinds of update requested.
- Private by default. New Discord categories and channels deny
@everyone. Slack channels are private. Telegram groups must be private, and public ones are refused. Repair never widens access: in Discord it puts back the recorded access, and in Slack it replaces a channel made public with a new private one. - Buttons only change GitNotify. Commands, menus and ownership buttons are GitNotify's own UI. Nothing in Discord, Slack or Telegram approves, merges, re-runs or deploys anything in GitHub.
People link themselves
Section titled “People link themselves”Nobody is notified unless they linked their own GitHub account in that server, workspace or group, and only review work and incidents notify anyone. Linking reads only the GitHub user id and login, and the token is revoked straight away. A handover target must also be linked there.
Escaping and mentions
Section titled “Escaping and mentions”Text from GitHub, such as titles, branch names and review comments, is stored raw and escaped by each platform's renderer:
- Discord: every message sends an explicit
allowed_mentionswith an emptyparselist, plus the one user it means to mention.@everyone,@hereand roles are never allowed. GitHub text is escaped for Discord's markdown. - Slack:
&,<and>are escaped, text is sent verbatim, and automatic link and mention parsing and link unfurls are off. Mentions are built only from the validated Slack ids of linked people. - Telegram: there is no way to turn mentions off, so GitHub text is clipped to one line,
&,<and>are escaped, and an invisible joiner goes after every@. Mentions aretg://user?id=links built only from the stored id of a linked person.
So a pull request titled @everyone deploy now cannot ping anyone.
Secrets are encrypted at rest
Section titled “Secrets are encrypted at rest”- Discord webhook URLs, Slack bot tokens and email relay secrets are sealed with AES-GCM under a versioned master key. The key can be rotated: new rows are written with the newest version, and older rows can still be opened.
- GitHub user tokens are used once and revoked. GitNotify never keeps one.
- The Telegram bot token and webhook secret are server secrets, never stored in the database. The bot token never appears in a log, an error message or an admin response.
- Secrets are never returned by the admin API.
Sign-in links go privately
Section titled “Sign-in links go privately”In Telegram, /connect and /link sign-in links and relay secrets are sent by private message only, never in the group, where any member could open them. If the bot can't message someone, it asks them to press Start and run the command again. In Discord and Slack, command replies are visible only to the person who ran the command.
Logs carry ids and outcomes, never titles, bodies, commit messages, chat text or secrets.
Delivery safety
Section titled “Delivery safety”- Every GitHub delivery is de-duplicated by its
X-GitHub-Deliveryid, so a redelivery changes nothing. - Facts and notifications are idempotent: each notification is recorded once it is sent, and never sent twice.
- Events that arrive out of order never move a run, job, reviewer or card backwards. Saves are compare-and-swap, so parallel work never loses an update.
- A deleted Discord webhook, an inaccessible Slack channel or a deleted Telegram topic pauses its route ("needs repair") instead of being retried.
- Commands are rate-limited per space and person, so one person can't flood a chat with setup or sign-in requests.
The email relay is not an open relay. GitNotify's signed request names only whose digest it is, and the relay looks up the address in its own list. Requests older than 5 minutes or already seen are refused, each recipient has a daily cap, and the Cloudflare binding can be locked to a fixed list of addresses. GitNotify only posts to relay addresses that use https:// and a public host name, and refuses redirects.
Self-hosted servers
Section titled “Self-hosted servers”A self-hosted server applies the same checks. Its operator holds the secrets: keep GITNOTIFY_MASTER_KEY and ADMIN_TOKEN long, random and out of version control, and back up the master key separately from the database. See Configuration and Operations.