# Authentication bypass on gist.github.com through SSH Certificates

SSH CA cert auth on gist.github.com failed to verify the login extension against the authenticated user, letting an attacker push to any user's gists.

- Payout: $10,000
- Severity: high
- Program: GitHub
- Found by: ammar2
- Disclosed: 2023-04-20
- CVE: CVE-2023-23761
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1901040
- Library page: https://bugbountylibrary.com/r/h1%3A1901040
- Tags: area:web domain:web impact:integrity kind:bounty platform:hackerone sev:high technique:chained technique:source-review vuln:access-control vuln:auth-bypass

**Target:** gist.github.com SSH certificate authority authentication flow
**Root cause:** The gist authentication flow trusted the `extension:login@github.com=username` field in an SSH CA certificate without verifying the certificate's principal actually matched the target username, so a cert could be minted for any identity.
**Steps:**
1. Obtain/register an SSH CA trusted by GitHub Enterprise Cloud org.
2. Mint a user certificate with `extension:login@github.com=<victim_username>` for an arbitrary victim.
3. Authenticate to gist.github.com over SSH using that certificate.
4. Push to the victim's gist repo (public or secret) using the known gist URL.
**How found:** Researcher reviewed the SSH CA authentication design, noted the login extension determines the authenticated username, and hypothesized the gist flow might not cross-check it against the cert principal.
**Exploitation:** Attacker with a CA-trusted cert sets the login extension to the victim's username, authenticates to gist.github.com, and pushes commits to the victim's gist; requires knowing the gist URL.
**Insight:** When a feature maps identity via a certificate extension/claim, test every downstream service (gists, pages, etc.) for whether it re-validates that claim against the actual principal rather than trusting it blindly.

