Skip to content
Access control Disclosed report Intermediate CVE-2023-46647

GHES Management console EoP (editor to site admin)

The management console's bootstrapping endpoint could be accessed by users with an editor role, allowing them to change the license and reset the site admin password. An attacker with an editor account could escalate to site admin and take full control of the deployment.

Imre Rad Follow

Originally disclosed on HackerOne

  • Triaged in 4 days
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 3 months

Summary by the program

Improper privilege management in all versions of GitHub Enterprise Server allows users with authorized access to the management console with an editor role to escalate their privileges by making requests to the endpoint used for bootstrapping the instance. CVE-2023-46647

Summary by the researcher

The Manage:App Rails controller of the Github Management console featured a method post "/start", which was accessible by both editors and operators (and of course by site admins as well). This method allowed changing the license of the deployment and also resetting the site admin password. A malicious/compromised editor account could escalate their privileges to site admin and access the GHES deployment without any restrictions.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

GitHub Enterprise Server (GHES) ships with a web-based Management Console that administrators use to configure and operate the instance. The console is documented for administrators and is reachable from the web UI. One of the controllers in that console is the Manage:App Rails controller. According to the report, this controller exposed a method mapped to post "/start", the endpoint used for bootstrapping the instance. That endpoint could change the deployment's licence and reset the site admin password.

The program's summary describes the underlying weakness as improper privilege management: users who have authorised access to the management console with an editor role can escalate their privileges by making requests to the bootstrapping endpoint. The issue is tracked as CVE-2023-46647 and affects all versions of GitHub Enterprise Server at the time.

Setup

The report does not describe a lab build, tooling or a specific GHES version. The precondition is an account on the management console with the editor role. The researcher also notes that the same endpoint was accessible to operators and, of course, to site admins. No other accounts, versions or tools are named.

Finding it

The researcher looked at the Manage:App Rails controller and found that the method behind post "/start" was reachable by editors and operators, not only by site admins. That endpoint is the one used for bootstrapping the instance, and it can change the licence of the deployment and reset the site admin password. An editor account is meant to have limited rights on the management console, so being able to call a bootstrapping action that resets the site admin password and changes the licence looked wrong: it gives an editor the means to take over the site admin account and therefore the deployment.

Exploitation

The report describes the exploitation path at the level of the endpoint and its effects; it does not include the raw HTTP request, headers, parameters or response bodies. The steps are therefore as follows.

Step 1: Obtain an editor account on the management console

The attacker needs authorised access to the management console with the editor role. The report frames the actor as a malicious or compromised editor account. No specific way of obtaining such an account is described.

Step 2: Send a request to the bootstrapping endpoint

With that editor session, the attacker makes a request to the endpoint used for bootstrapping the instance, which the report identifies as the post "/start" method on the Manage:App Rails controller. The report does not reproduce the request.

Step 3: Reset the site admin password and change the licence

The endpoint allows resetting the site admin password and changing the licence of the deployment. By calling it, the editor can set a new site admin password and take control of the site admin account.

Step 4: Access the deployment as site admin

Once the site admin password has been reset, the attacker can access the GHES deployment without any restrictions, as the report puts it. The licence change is the second effect of the same endpoint.

Root cause

The mistake is one of authorisation on the Manage:App controller: the post "/start" action, which performs bootstrapping operations including a site admin password reset and a licence change, was accessible to editors and operators as well as site admins. The report does not show the controller code or the checks that were or were not present, so the exact mechanism is not stated. The design issue is that a privileged bootstrapping action was not restricted to the highest role.

Impact

A malicious or compromised editor account on the management console can escalate to site admin by resetting the site admin password through the bootstrapping endpoint, and can also change the licence of the deployment. The result is unrestricted access to the GHES deployment. The program describes the weakness as improper privilege management.

Fix

The program's summary states the weakness as improper privilege management in all versions of GitHub Enterprise Server, and the issue is tracked as CVE-2023-46647. What should change follows from the finding: the bootstrapping action behind post "/start" should be restricted to site admins and not be callable by editors or operators.

Variants to test

  1. On another management or admin console, enumerate every route on controllers that handle bootstrapping, licence changes or password resets, and try each one with the lowest privileged role that can reach the console. A positive result is a successful state change, such as a password reset or licence update, performed by a role that should not be allowed to do it.
  2. Look for actions that are shared between roles by design, such as endpoints reachable by both editors and operators, and check whether any of them perform security-sensitive operations. A positive result is a sensitive operation succeeding from the lower role.
  3. Test whether a password reset or licence change performed through such an endpoint takes effect for the site admin account, and whether the session of the lower-privileged user can then authenticate as site admin. A positive result is a working login as site admin after the reset.
  4. Check other console features that are documented for administrators but exposed on the same controller as lower-privileged features. A positive result is any administrator-only action that responds successfully to a lower-privileged session.

Hunting notes

This kind of bug tends to hide in administrative consoles where roles are coarse and controllers mix actions intended for different roles. During recon, the signals are a management console reachable over the web, documented roles such as editor and operator, and endpoints whose names suggest bootstrapping, setup, licence management or password reset. The researcher showed impact by identifying a specific endpoint, post "/start" on the Manage:App controller, and stating the two concrete effects it allowed from an editor account: resetting the site admin password and changing the licence, which leads to unrestricted access to the deployment.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

GitHub Enterprise Server (GHES) is a version of GitHub that a company runs on its own servers, inside its own network, instead of using github.com. Because it lives on the company's own machines, it comes with a separate web page called the Management Console, where administrators set up and look after the instance: things like the licence, the configuration and the accounts.

The Management Console has roles. A site admin is the highest role named in the report. The report says the endpoint was accessible to editors and operators as well as site admins. The idea behind roles is simple: a person should only be able to do what their job needs. Think of a hotel: the manager has a master key, the cleaner has a key to the rooms they clean, and the receptionist can check guests in. If the cleaner's key also opened the manager's office and the safe, the roles would be meaningless.

In this report, a researcher found that one action in the Management Console, the one used to bootstrap the instance, could be triggered by an editor and by an operator, not just by a site admin. Bootstrapping is the first-time setup work that brings an instance to life. That same action could also change the deployment's licence and reset the site admin password. So an editor could reset the password of the site admin account through that endpoint. The program describes this as improper privilege management and tracks it as CVE-2023-46647. It affects all versions of GitHub Enterprise Server at the time.

Context

GitHub Enterprise Server ships with a web-based Management Console that administrators use to configure and operate the instance. The console is documented for administrators and is reachable from the web UI. One of the controllers in that console is the Manage:App Rails controller.

A few words on those terms. A controller is a piece of a web application that receives a request for a particular address and decides what to do with it. Rails is a programming framework for building web applications, and it groups related actions into controllers. So Manage:App is the part of the Management Console that handles application-level management actions.

According to the report, this controller exposed a method mapped to post "/start", the endpoint used for bootstrapping the instance. An endpoint is a specific address on a server that accepts a particular kind of request. The word post is the HTTP method, the verb a browser or tool uses when it sends data to the server rather than just asking for a page. The path /start is the address itself. Together, post "/start" means: send data to the /start address.

That endpoint could change the deployment's licence and reset the site admin password. A licence here is the record that says the company is allowed to run the product, and in GHES it is managed through the console. Resetting the site admin password means setting a new password for the most privileged account on the instance.

The program's summary describes the underlying weakness as improper privilege management: users who have authorised access to the management console with an editor role can escalate their privileges by making requests to the bootstrapping endpoint. Privilege escalation means moving from a lower level of permission to a higher one, usually without being given that higher level. The issue is tracked as CVE-2023-46647 and affects all versions of GitHub Enterprise Server at the time. A CVE is a public identifier for a known security flaw, so people can refer to the same issue unambiguously.

Setup

The report does not describe a lab build, tooling or a specific GHES version. The precondition is an account on the management console with the editor role. The researcher also notes that the same endpoint was accessible to operators and, of course, to site admins. No other accounts, versions or tools are named.

Finding it

The researcher looked at the Manage:App Rails controller and found that the method behind post "/start" was reachable by editors and operators, not only by site admins. That endpoint is the one used for bootstrapping the instance, and it can change the licence of the deployment and reset the site admin password.

An editor account is meant to have limited rights on the management console, so being able to call a bootstrapping action that resets the site admin password and changes the licence looked wrong. It gives an editor the means to take over the site admin account and therefore the deployment. The reasoning is the same as the hotel key: if a limited role can perform an action reserved for the top role, the limit is not real.

Exploitation

The report describes the exploitation path at the level of the endpoint and its effects; it does not include the raw HTTP request, headers, parameters or response bodies. The steps are therefore as follows.

Step 1: Obtain an editor account on the management console

The attacker needs authorised access to the management console with the editor role. The report frames the actor as a malicious or compromised editor account. No specific way of obtaining such an account is described. A compromised account is one whose password or session has been stolen or guessed by someone else, so the attacker is using it as if it were their own.

Step 2: Send a request to the bootstrapping endpoint

With that editor session, the attacker makes a request to the endpoint used for bootstrapping the instance, which the report identifies as the post "/start" method on the Manage:App Rails controller. The report does not reproduce the request.

A session is how a website remembers that you are logged in between page loads. After you sign in, the server gives your browser a small piece of data, often called a cookie, and the browser sends it back with every request. The server looks at it and knows who you are. If an attacker has an editor session, the server treats their requests as coming from that editor.

Step 3: Reset the site admin password and change the licence

The endpoint allows resetting the site admin password and changing the licence of the deployment. By calling it, the editor can set a new site admin password and take control of the site admin account. The licence change is the second effect of the same endpoint.

Step 4: Access the deployment as site admin

Once the site admin password has been reset, the attacker can access the GHES deployment without any restrictions, as the report puts it. In other words, the attacker now holds the credentials of the highest-privileged account, so every restriction that applied to the editor role no longer applies.

Root cause

The mistake is one of authorisation on the Manage:App controller: the post "/start" action, which performs bootstrapping operations including a site admin password reset and a licence change, was accessible to editors and operators as well as site admins. Authorisation is the check that decides whether a logged-in user is allowed to do a particular thing. Authentication is proving who you are; authorisation is deciding what you may do once you are known.

The report does not show the controller code or the checks that were or were not present, so the exact mechanism is not stated. The design issue is that a privileged bootstrapping action was not restricted to the highest role.

Impact

A malicious or compromised editor account on the management console can escalate to site admin by resetting the site admin password through the bootstrapping endpoint, and can also change the licence of the deployment. The result is unrestricted access to the GHES deployment. The program describes the weakness as improper privilege management.

Fix

The program's summary states the weakness as improper privilege management in all versions of GitHub Enterprise Server, and the issue is tracked as CVE-2023-46647. What should change follows from the finding: the bootstrapping action behind post "/start" should be restricted to site admins and not be callable by editors or operators.

Variants to test

These are ideas for looking for the same kind of mistake elsewhere.

  1. On another management or admin console, enumerate every route on controllers that handle bootstrapping, licence changes or password resets, and try each one with the lowest privileged role that can reach the console. A positive result is a successful state change, such as a password reset or licence update, performed by a role that should not be allowed to do it.
  2. Look for actions that are shared between roles by design, such as endpoints reachable by both editors and operators, and check whether any of them perform security-sensitive operations. A positive result is a sensitive operation succeeding from the lower role.
  3. Test whether a password reset or licence change performed through such an endpoint takes effect for the site admin account, and whether the session of the lower-privileged user can then authenticate as site admin. A positive result is a working login as site admin after the reset.
  4. Check other console features that are documented for administrators but exposed on the same controller as lower-privileged features. A positive result is any administrator-only action that responds successfully to a lower-privileged session.

Hunting notes

This kind of bug tends to hide in administrative consoles where roles are coarse and controllers mix actions intended for different roles. Recon is the early phase of looking around a target to understand what it is made of before trying anything.

During recon, the signals are a management console reachable over the web, documented roles such as editor and operator, and endpoints whose names suggest bootstrapping, setup, licence management or password reset. The researcher showed impact by identifying a specific endpoint, post "/start" on the Manage:App controller, and stating the two concrete effects it allowed from an editor account: resetting the site admin password and changing the licence, which leads to unrestricted access to the deployment.

Glossary

  • API: a defined set of addresses and rules that one piece of software uses to talk to another, so a program can ask a service to do something without a human clicking.
  • Authentication: proving who you are, usually with a username and password.
  • Authorisation: deciding what a known user is allowed to do.
  • Bootstrapping: the first-time setup work that brings an instance into a working state.
  • Controller: the part of a web application that receives a request for an address and decides how to handle it.
  • Cookie: a small piece of data a website stores in your browser and gets back on later requests, often used to remember that you are logged in.
  • CVE: a public identifier for a known security flaw, so the same issue can be referred to unambiguously.
  • Deployment: a particular running installation of a product, here one company's GHES instance.
  • Editor: a limited role on the GHES Management Console, below site admin.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • GHES: GitHub Enterprise Server, a version of GitHub that a company runs on its own servers.
  • HTTP method: the verb in a web request, such as post, which sends data to the server.
  • Licence: the record that says a company is allowed to run the product, managed through the console in GHES.
  • Management Console: the web interface administrators use to configure and operate a GHES instance.
  • Operator: a limited role on the GHES Management Console, alongside editor and site admin.
  • Privilege escalation: moving from a lower level of permission to a higher one without being given that higher level.
  • Rails: a framework for building web applications, which groups related actions into controllers.
  • Recon: the early phase of looking around a target to understand what it is made of before trying anything.
  • Role: a named set of permissions given to an account, such as editor, operator or site admin.
  • Session: how a website remembers that you are logged in between page loads.
  • Site admin: the highest-privileged account on a GHES instance.
  • Web UI: a user interface you use through a browser.

More by Imre Rad

View all

2 more disclosed reports, best first.

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.