Skip to content
RCE Disclosed report Intermediate CVE-2024-1378

Management Console Editor Privilege Escalation to Root SSH Access in GitHub Enterprise Server via nomad template injection

A command injection flaw in GitHub Enterprise Server's Management Console allowed an editor to inject commands via nomad templates when configuring SMTP options. This let the attacker escalate privileges to admin SSH access on the appliance.

inspector-ambitious Follow

Originally disclosed on HackerOne

  • Triaged in 16 days
  • Fixed in 2 months
  • Paid in 2 months
  • Disclosed after 8 months

Summary by the program

A command injection vulnerability was identified in GitHub Enterprise Server that allowed an attacker with an editor role in the Management Console to gain admin SSH access to the appliance via nomad templates when configuring SMTP options. Exploitation of this vulnerability required access to the GitHub Enterprise Server instance and access to the Management Console with the editor role. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.12 and was fixed in versions 3.11.5, 3.10.7, 3.9.10, and 3.8.15. This vulnerability was reported via the GitHub Bug Bounty program.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

GitHub Enterprise Server (GHES) is the self-hosted appliance version of GitHub. It ships with a Management Console, a separate administrative interface used to configure the appliance, including SMTP settings for outgoing mail. The Management Console has its own role model, and one of those roles is editor: a user who can change configuration but is not meant to have full administrative or shell access to the underlying machine.

The report describes a command injection vulnerability in that console. An attacker holding the editor role could use nomad templates, supplied while configuring SMTP options, to run commands and escalate to admin SSH access on the appliance. The program's summary states the outcome plainly: editor in the Management Console becomes admin SSH on the box.

The preconditions are narrow and worth stating exactly as given. Exploitation required access to the GHES instance and access to the Management Console with the editor role. So this is a privilege escalation from a delegated administrative role to full control of the appliance, not an unauthenticated remote compromise.

Affected and fixed versions, as listed:

Status Versions
Affected all versions prior to 3.12
Fixed 3.11.5, 3.10.7, 3.9.10, 3.8.15

The issue was reported through the GitHub Bug Bounty program and rated high severity, with the weakness classified as generic command injection. The report does not include the individual requests, payloads or template contents used, so there is no code to reproduce here.

Root cause

The report says the injection was reached through nomad templates supplied while configuring SMTP options in the Management Console. If an editor can place attacker-controlled template content into a configuration that the appliance later renders, the rendering step becomes a command execution primitive running with the privileges of whatever service processes it, which in this case is enough to reach admin SSH access.

The report does not describe the exact code path, so the precise validation gap is not public.

Impact

An attacker who already holds the editor role in the Management Console can turn that role into admin SSH access to the appliance. The editor role is intended to be less than full administrative control, and this bug turns it into admin SSH access to the appliance. The report's own hedge matters: the attacker needs access to the instance and to the console with the editor role first, so the vulnerability is an escalation step rather than an entry point.

How this kind of bug works

Command injection through a template engine is a variant of the classic problem: data crosses from a context where it is inert (a configuration field, a form value, a stored setting) into a context where it is interpreted (a shell, a template renderer, an expression evaluator). Template engines such as those used by orchestration tools are especially dangerous because they often expose functions that read files, run commands or query the environment by design. A field that looks like plain text to the person filling in a form can be a program to the renderer.

The usual enablers are: no allow-list on what a configuration value may contain, rendering performed as a privileged service, and role checks that stop at "can edit this page" without considering what editing that page can cause downstream. Defences are layered: strict validation or escaping of values before rendering, disabling dangerous template functions, rendering in a sandbox or unprivileged context, and treating every console role as a potential attacker when designing what that role can influence.

How to test for it

  1. Map the features available to each role. Log in with the lowest privileged account you have and enumerate every configuration page, especially mail, notification, integration and job or runner settings.
  2. Identify fields whose values are likely consumed by a template engine or a scheduler later, rather than displayed immediately. Names containing template, job, runner, hook or script are signals.
  3. Send a benign marker that a template engine would evaluate, such as a simple arithmetic expression or an environment variable reference, and observe whether the stored value is rendered or executed rather than echoed literally. Use out-of-band interaction (a request to a host you control) to confirm execution when output is not visible.
  4. If a marker executes, establish the privilege level of the execution context: read the current user, hostname and a file only a privileged account could read. Stop there; do not modify the system.
  5. A positive result is a stored value that causes evaluation or a callback from the server. Common false positives are client-side rendering of your input, a value echoed back unescaped in HTML (cross-site scripting, not command injection), or a callback caused by your own browser rather than the server.

How it is fixed

The standard fixes are to validate or reject template syntax in fields that should hold plain configuration, to disable or restrict dangerous template functions, to render templates in a sandbox or as an unprivileged user, and to review role permissions so that editor-level access cannot reach execution-capable configuration. The report gives the fix only as the release versions listed above.

Hunting notes

This class hides in administrative surfaces that are assumed to be trusted: management consoles, CI and runner configuration, notification and mail settings, webhook templates, and anything that feeds a scheduler or orchestrator. Recon signals include separate admin interfaces on non-standard ports, role models with an editor tier, and product documentation mentioning templates, jobs or orchestration internally. To get a report accepted, demonstrate the boundary you crossed (a lower role reaching higher privilege), keep the proof minimal and non-destructive, and state the preconditions honestly so the triager can judge severity.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

GitHub Enterprise Server (GHES) is a version of GitHub that a company installs and runs on its own machine, rather than using GitHub's website. Think of it as a private copy of GitHub that lives in your own building. It comes with a separate administrative interface called the Management Console, which is used to set up the appliance, including the settings for outgoing email (SMTP).

The Management Console has its own set of roles. One of them is editor: a person who can change settings but is not supposed to have full control of the machine underneath. The report describes a command injection vulnerability in that console. An attacker who already had the editor role could use nomad templates, supplied while configuring the SMTP options, to run commands and escalate to admin SSH access on the appliance. In plain terms: editor in the Management Console becomes admin SSH on the box.

A command injection is when a program takes data it should treat as plain input and passes it to the operating system as if it were a command to run. Imagine a form that asks for a filename and then runs a command like "open the file you named". If you type a filename that also contains extra instructions, the computer may follow those instructions too. That is the essence of the bug.

A template is a piece of text with placeholders that a program fills in later. A nomad template is a template handled by Nomad, a tool that runs and manages jobs on servers. If an editor can put their own template content into a setting that the appliance later renders, the rendering step becomes a way to run commands, with the privileges of whatever service does the rendering. Here that was enough to reach admin SSH access.

SSH is a way to log in to a machine remotely and run commands on it. Admin SSH access means logging in with the highest level of control. So the bug let a limited administrator gain admin SSH access to the machine.

The preconditions are narrow and worth stating exactly as given. Exploitation required access to the GHES instance and access to the Management Console with the editor role. This is a privilege escalation from a delegated administrative role to full control of the appliance, not an unauthenticated remote compromise. In other words, the attacker needed access to the instance and an editor account in the Management Console before this bug helped them.

Affected and fixed versions, as listed:

Status Versions
Affected all versions prior to 3.12
Fixed 3.11.5, 3.10.7, 3.9.10, 3.8.15

The issue was reported through the GitHub Bug Bounty program and rated high severity, with the weakness classified as generic command injection. The report does not include the individual requests, payloads or template contents used, so there is no code to reproduce here.

In general, how this kind of bug works

Command injection through a template engine is a variant of a classic problem: data crosses from a place where it is harmless (a configuration field, a form value, a stored setting) into a place where it is interpreted (a shell, a template renderer, an expression evaluator). Template engines such as those used by orchestration tools are especially dangerous because they often expose functions that read files, run commands or query the environment by design. A field that looks like plain text to the person filling in a form can be a program to the renderer.

The usual enablers are: no allow-list on what a configuration value may contain, rendering performed as a privileged service, and role checks that stop at "can edit this page" without considering what editing that page can cause downstream. Defences are layered: strict validation or escaping of values before rendering, disabling dangerous template functions, rendering in a sandbox or unprivileged context, and treating every console role as a potential attacker when designing what that role can influence.

How to test for it

  1. Map the features available to each role. Log in with the lowest privileged account you have and enumerate every configuration page, especially mail, notification, integration and job or runner settings.
  2. Identify fields whose values are likely consumed by a template engine or a scheduler later, rather than displayed immediately. Names containing template, job, runner, hook or script are signals.
  3. Send a benign marker that a template engine would evaluate, such as a simple arithmetic expression or an environment variable reference, and observe whether the stored value is rendered or executed rather than echoed literally. Use out-of-band interaction (a request to a host you control) to confirm execution when output is not visible.
  4. If a marker executes, establish the privilege level of the execution context: read the current user, hostname and a file only a privileged account could read. Stop there; do not modify the system.
  5. A positive result is a stored value that causes evaluation or a callback from the server. Common false positives are client-side rendering of your input, a value echoed back unescaped in HTML (cross-site scripting, not command injection), or a callback caused by your own browser rather than the server.

How it is fixed

The standard fixes are to validate or reject template syntax in fields that should hold plain configuration, to disable or restrict dangerous template functions, to render templates in a sandbox or as an unprivileged user, and to review role permissions so that editor-level access cannot reach execution-capable configuration. The report gives the fix only as the release versions listed above.

Hunting notes

This class hides in administrative surfaces that are assumed to be trusted: management consoles, CI and runner configuration, notification and mail settings, webhook templates, and anything that feeds a scheduler or orchestrator. Recon signals include separate admin interfaces on non-standard ports, role models with an editor tier, and product documentation mentioning templates, jobs or orchestration internally. To get a report accepted, demonstrate the boundary you crossed (a lower role reaching higher privilege), keep the proof minimal and non-destructive, and state the preconditions honestly so the triager can judge severity.

Glossary

  • GitHub Enterprise Server (GHES): a self-hosted version of GitHub that a company runs on its own machine.
  • Management Console: a separate administrative interface used to configure the GHES appliance.
  • SMTP: the protocol used to send outgoing email.
  • Role: a named set of permissions given to a user account.
  • Editor role: a console role that can change configuration but is not meant to have full administrative or shell access.
  • Command injection: a vulnerability where user-supplied data is passed to the operating system and run as a command.
  • Nomad: a workload orchestrator that runs and manages jobs on servers.
  • Template: text with placeholders that a program fills in or evaluates later.
  • Nomad template: a template handled by Nomad as part of running a job.
  • Rendering: the step where a template engine fills in or evaluates a template.
  • SSH: a way to log in to a machine remotely and run commands on it.
  • Admin SSH access: remote login with the highest level of control over a machine.
  • Privilege escalation: gaining a higher level of access than you were given.
  • Unauthenticated remote compromise: an attack that needs no account and is carried out over the network.
  • Bug Bounty program: a scheme where organisations pay researchers for reporting security bugs.
  • Severity: a rating of how serious a vulnerability is.
  • Allow-list: a list of values that are explicitly permitted, with everything else rejected.
  • Escaping: transforming data so it is treated as plain text rather than as code.
  • Sandbox: an isolated environment that limits what code can do.
  • Out-of-band interaction: confirming execution by making the server contact a host you control.
  • Cross-site scripting (XSS): a bug where attacker input is echoed into a page and runs as script in a browser.
  • False positive: a test result that looks like a bug but is not.
  • Triager: the person who reviews a bug report and decides whether it is valid.

More by inspector-ambitious

View all

15 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.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.