Executive brief
Semaphore UI is a continuous delivery automation platform used to orchestrate and execute deployment workflows. An authenticated attacker holding a project manager or owner role can inject arbitrary commands via a malicious repository URL. These commands execute inside the main server process, bypassing any isolation that remote runners would normally provide, and can access sensitive data including encryption keys and project secrets.
Technical details
The vulnerability is an OS command injection via argument injection in git command construction. Semaphore accepts user-controlled git_url input from the HTTP POST /api/project/{id}/repositories endpoint without validating it for git option injection (unlike the git_branch field which rejects leading hyphens). The git_url is passed directly to exec.Command("git") in CmdGitClient.GetLastRemoteCommitHash without a -- argument separator. An attacker supplies a crafted git_url such as "--upload-pack=<malicious_cmd>;true", which git interprets as an option rather than a repository URL. The git command then executes the payload via shell invocation. Exploitation requires: (1) authenticated account, (2) Manager or Owner role on a project, (3) creation of a repository and schedule tied to that repository. The command executes in the schedule pool running within the main server process, independent of remote runner configuration. Patch version 0.0.0-20260704181911-7e8a9434bd81 addresses this issue.
Affected products
- Semaphore UI Semaphore < 0.0.0-20260704181911-7e8a9434bd81
Timeline
- 2026-09-08: disclosed: GitHub Security Advisory published
- 2026-07-04: patched: Patch version 0.0.0-20260704181911-7e8a9434bd81 released