OSV 1.4.0 · github-reviewed · 修改于 2026-09-04 03:23
发布时间
2026-09-04 03:23
GitHub 审查时间
2026-09-04 03:23
NVD 发布时间
2026-08-13 00:17
源文件
advisories/github-reviewed/2026/09/GHSA-cxvf-gvfq-36w2/GHSA-cxvf-gvfq-36w2.json
Semaphore resolves a project member's effective permissions in ProjectMiddleware by looking up a role row whose slug matches the member's assigned role, and overwrites the built-in permission bitmask with that row's value. A member holding the built-in manager role creates a custom project role through POST /api/project/{id}/roles, a route gated only by the CanManageProjectResources permission that manager already holds.
The role-creation validator does not reserve the built-in slug names (owner, manager, task_runner, guest) and sets no ceiling on the permission bits a caller may grant. A manager creates a role with slug manager carrying the full bitmask 15, including the two owner-only bits CanUpdateProject and CanManageProjectUsers that manager does not hold. The slug lookup that backs permission resolution ignores project scope, so this attacker-created row is returned on the next request and the manager's effective permissions become owner-equivalent.
Result: a project manager escalates to full owner of the project with one authenticated request, then adds or removes members, changes project settings, deletes the project, or demotes the legitimate owner.
semaphoreui/semaphore v2.18.12 (current latest as of 2026-06-09) and develop HEAD. Confirmed live-exploitable on v2.18.12 (commit 8a4dcf0); the affected files are unchanged on develop with no fix commit since the tag. Earlier releases that ship PRO custom project roles are likely affected but were not tested.
Requires the PRO build (custom project roles). The official semaphoreui/semaphore Docker image ships this feature active by default, with no subscription or configuration flag.
Pure community builds without custom project roles are not affected: the role-creation endpoint returns 404 there.
ProjectMiddleware reads the member's built-in role permissions, then calls GetProjectOrGlobalRoleBySlug and, when a role row shares the member's role slug, replaces the effective permission bitmask with the database value (). accepts a project id but runs , ignoring project scope (). checks only that the role name is non-empty, and enforces neither a reserved-slug list nor a permission ceiling (). The role-creation route is gated by (), a bit the built-in role holds, while the actions it unlocks are gated by the owner-only and (). A manager creates a row with slug and permissions , and the next request resolves the manager's effective permissions to the owner bitmask.
api/projects/project.go:49-53GetProjectOrGlobalRoleBySlug(projectID, slug)select * from role where slug=?db/sql/role.go:59-62ValidateRoledb/Role.go:10-15POST /api/project/{id}/rolesCanManageProjectResourcesapi/router.go:294,354managerCanUpdateProjectCanManageProjectUsersapi/router.go:364,380manager15semaphoreui/semaphore v2.18.12 Docker (official image, PRO build), default config, default roles.
manager role; the attacker confirms the baseline, where owner-only endpoints are denied.GET /api/project/42/role Cookie: semaphore=<manager-session>
-> {"role":"manager","permissions":5}
PUT /api/project/42 Cookie: semaphore=<manager-session>
-> HTTP/1.1 403 Forbidden
manager and carries every permission bit.POST /api/project/42/roles Cookie: semaphore=<manager-session>
Content-Type: application/json
{"slug":"manager","name":"pwn","permissions":15}
-> HTTP/1.1 201 Created
{"slug":"manager","name":"pwn","permissions":15,"project_id":42}
GET /api/project/42/role -> {"role":"manager","permissions":15}
PUT /api/project/42 {"id":42,"name":"owned","alert":false} -> 204 No Content
POST /api/project/42/users {"user_id":99,"role":"task_runner"} -> 204 No Content
Live-verified: a manager with permissions 5 obtains permissions 15 with one POST, then changes project settings and adds project members, both of which return 403 before the role is created.
manager role in default config with one request; not reachable by task_runner, guest, or unauthenticated callers.Jan Kahmen, turingpoint ([email protected])