GHSA-wm25-49w3-5qrg - AdminNeo: CSRF Token Secret Recoverable from Single Observed Token, Enabling Cross-Site Request Forgery
### Summary
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](https://github.com/vrana/adminer/security/advisories/GHSA-33j4-hc95-pggg)
### Details
Token generation in `admin/include/functions.inc.php` lines 1181-1184:
```php
function get_token() {
$rand = rand(1, 1e6);
return ($rand ^ $_SESSION["token"]) . ":$rand";
}
```
Token verification in lines 1189-1192:
```php
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:
```php
$_SESSION["token"] = rand(1, 1e6);
```
**Three distinct weaknesses:**
1. **Instant recovery:** The token format `(rand XOR secret):rand` transmits both operands. Recovery is trivial: `secret = masked_value XOR rand`.
2. **Low entropy**: Only 1,000,000 possible session tokens (~20 bits). Blind brute-force requires at most 1M requests.
3. **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:
```html
<input type='hidden' name='token' value='222277:990527'>
```
Token observation vectors: Referrer header leak, shared proxy logs, browser history, limited XSS, network snif
MEDIUM
Severity & confidence
Source severitymedium
Platform severitymedium
Confidencemedium
Exploitationunknown
CVSS6.8
Affected
Vendorsadminneo-org
Productsadminneo-org/adminneo
Reporting sources (1)
GitHub Security Advisories
Timeline & provenance
Published2026-10-30T22:51:29
Last updated2026-11-09T09:51:15
Ingested2026-10-30T22:59:15
FreshnessNEAR-REAL-TIME
Threat typeadvisory
Recommended action
Review the advisory and upgrade affected packages to the first patched version.
Next steps
- Identify affected systems in your environment.
- Apply the vendor patch or mitigation guidance.
- Review logs for indicators described in the advisory.
- Follow the affected vendor/product to track updates.
Confidence explanation
Reported by a single or secondary source; treat as indicative, verify before acting.
Source type: vendor ยท Original: GitHub Security Advisories