llamaCVEVulnerability Intelligence
/
Advisory · GitHub

GHSA-2X4J-P4PR-FVP8

apikey_manager role can mint OTA-deploy-capable API keys it does not itself hold

Sin parche publicado
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición72 dDesde la divulgación, 8 sept 2026, 9:20 a. m.
Detección71 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
8 sept 26
18 nov 26
20 nov 26
8 sept 26
26 sept 26
14 oct 26
2 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-2X4J-P4PR-FVP8 divulgada
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

SUMMARY
================================================================
The apikey_manager org role is intended to manage API keys for CI/CD without holding role-assignment rights — it
carries only org.manage_apikeys + org.read. When such a caller creates an API key, the only guards on which roles
they may bake into the key are (1) a fixed deny-list of role names and (2) a priority-rank check (assigned role's
priority_rank must be <= the caller's max rank). The deny-list omits the four deploy roles app_developer,
app_uploader, channel_developer, channel_uploader, and apikey_manager is seeded with priority_rank 78 — above all
of those roles' ranks — so the rank check passes. There is no check that the caller actually possesses the
permissions the assigned role confers. As a result, an apikey_manager (which cannot upload bundles, promote
channels, build native, or manage devices) can mint an API key bound to app_developer/app_uploader/channel_* and
then use that key to push arbitrary OTA JavaScript updates to every end-user of the org's apps.

================================================================
DOMAIN
================================================================
- Backend repo: github.com/Cap-go/capgo (supabase/functions/_backend/public/apikey/ +
_backend/private/role_bindings.ts + seed.sql).
- Live: POST /apikey on the Capgo API.

================================================================
VULNERABLE ENDPOINT / CODE
================================================================
- Create path applies exactly three gates: org.manage_apikeys (public/apikey/post.ts:155), the deny-list (:156),
and the rank check (private/role_bindings.ts:620). None requires the caller to already hold the app/channel
permissions being granted.
- Deny-list is incomplete: APIKEY_MANAGER_DENIED_ASSIGNABLE_ROLES = {org_super_admin, org_admin, app_admin,
app_preview, channel_admin} (public/apikey/scope.ts:166-172) — omits app_developer / app_uploader /
channel_developer / channel_uploader.
- Anti-escalation is rank-only: createRoleBindingForPrincipal denies only if role.priority_rank > callerMaxRank
(role_bindings.ts:620); getCallerMaxPriorityRank returns the caller's own max binding rank (:501-541). No
permission-subset/delegation check.
- Ranks (migrations/20260708000000_prod_baseline.sql:24368-24377, seed.sql:1417): apikey_manager=78, app_admin=70,
app_developer=68, app_uploader=66, channel_admin=60, channel_developer=58, channel_uploader=57. Assigning
app_developer(68)/app_uploader(66)/channel_developer(58)/channel_uploader(57) all pass rank <= 78.
- apikey_manager's own permissions: only org.manage_apikeys + org.read (seed.sql:1428-1435) — no app.upload_bundle,
channel.promote_bundle, app.build_native, app.manage_devices.

================================================================
STEPS TO REPRODUCE
================================================================
1. Have a user assigned only the apikey_manager role in an org (via a JWT session — key creation is JWT-only,
post.ts:99-104).
2. POST /apikey with a role binding for a deploy role, e.g.:

POST https://<capgo-host>/apikey
Authorization: Bearer <apikey_manager_JWT>
Content-Type: application/json

{"name":"ci","mode":"all","bindings":[
{"role_name":"app_developer","scope_type":"app","org_id":"<org_id>","app_id":"<app_id>"}]}

The call passes assertApiKeyManagerCanAssignBindings (app_developer not on the deny-list) and the priority
check (68 <= 78), and returns a key.
3. Use the returned key to upload a bundle and promote it to a channel (app.upload_bundle / channel.promote_bundle)
— capabilities the apikey_manager principal does not hold directly.

See poc/f3_apikey_manager_mint.sh.

================================================================
IMPACT
================================================================
Privilege escalation / least-privilege violation: a key-management-only principal gains OTA-deploy capability — it
can push arbitrary JavaScript updates to all end-users of the org's apps, trigger native builds, and manage
devices, none of which it is granted directly. Confined to the caller's own org (not cross-tenant).
Honest note: this may be contested as by-design (the role is described as "manage API keys for CI/CD," and CI/CD
keys are deploy keys). The counter-argument is that the deny-list exists specifically to prevent an apikey_manager
from conferring privileged roles — it blocks the admin roles but leaves the actual deploy roles assignable, which
is an incomplete restriction, and the rank-78 seeding neutralizes the priority guard for exactly these roles.

================================================================
SUGGESTED FIX
================================================================
Replace the deny-list with an explicit allow-list of read-only roles for managers lacking org.update_user_roles,
or add the four deploy roles to APIKEY_MANAGER_DENIED_ASSIGNABLE_ROLES; better, require that any role a manager
assigns be a subset of the permissions the manager already holds (true delegation check). Reconsider
apikey_manager priority_rank 78 sitting above app/channel roles.

================================================================
REFERENCE
================================================================
- supabase/functions/_backend/public/apikey/scope.ts:166-201
- supabase/functions/_backend/public/apikey/post.ts:99-104,150-204
- supabase/functions/_backend/private/role_bindings.ts:501-541,618-622
- supabase/seed.sql:1417,1428-1435; supabase/migrations/20260708000000_prod_baseline.sql:24368-24377

---

Fix PR (open)

Intentional fix PR https://github.com/Cap-go/capgo.app/pull/3221 (open). Prevents apikey_manager from minting deploy/OTA roles the caller does not hold.

Do not disclose this advisory in the PR. Bounty/credit is due only after merge, production release, and reporter verification.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Remediación

Estado del parche por paquete

La fuente no informa paquetes ni versiones corregidas.

Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/Cap-go/capgo.app/security/advisories/GHSA-2x4j-p4pr-fvp8

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.