Skip to content
Access control Disclosed report Advanced CVE-2023-23761

Authentication bypass on gist.github.com through SSH Certificates

A missing check in the gist authentication flow meant an SSH certificate authority certificate could be used to act as any username. An attacker who knew a gist's URL could push changes to another user's gists, including secret ones.

ammar2 Follow

Originally disclosed on HackerOne

Bounty$10,000 High View original
  • Triaged in 3 days
  • Fixed in 37 days
  • Paid in 37 days
  • Disclosed after 40 days

Summary by the program

An improper authentication vulnerability was identified in GitHub Enterprise Server that allowed an unauthorized actor to modify other users' secret gists by authenticating through an SSH certificate authority. To do so, a user had to know the secret gist's URL. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.9 and was fixed in versions 3.4.18, 3.5.15, 3.6.11, 3.7.8, and 3.8.1. This vulnerability was reported via the GitHub Bug Bounty program.

Summary by the researcher

Github supports SSH certificate authority authentication for Github Enterprise Cloud customers. As part of certificate authority authentication, the certificate contains a extension:[email protected]=username corresponding to which username from the organization to authenticate as.

Due to a missed check in the gist.github.com authentication flow, an attacker could create a certificate giving them access to push to any username's gists.


Minor correction on the vendor description, it's not just secret gists that were at risk. An attacker could have pushed changes to a user's public gists as well.

The original report as published on HackerOne, by ammar2. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the gist authentication flow trusted the username claim inside an SSH certificate without verifying that the certificate was issued for that user.

Impact

An attacker who knew a gist's URL could push changes to another user's gists, both secret and public ones.

What the attacker needed

GitHub Enterprise Server before 3.9; SSH certificate authority access; knowledge of the gist URL

The fix

The vulnerability was fixed in several GitHub Enterprise Server releases.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

GitHub lets organisations trust their own SSH certificates, and each certificate names the user it stands for. The gist service failed to confirm that the name in the certificate really belonged to the person using it, so anyone with such a certificate could pretend to be someone else. They still needed the gist's web address to reach it.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from GitHub

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.