CVE-2026-56425·PHP vulnerability
The Azure Active Directory (AAD) authentication implementation contained multiple weaknesses in its OAuth 2.0 authorization flow that could allow attackers to bypass important security guarantees provided by the protocol. The application used the PHP session identifier (session_id()) as the OAuth state parameter. Because session identifiers are long-lived authentication credentials, exposing them in OAuth redirect URLs could leak valid session tokens through browser history, HTTP Referer headers, reverse proxies, access logs, or third-party infrastructure involved in the authentication flow. If obtained by an attacker, the leaked session identifier could potentially be used for session hijacking. Additionally, the implementation did not regenerate the session identifier after successful authentication, leaving authenticated sessions susceptible to session fixation attacks where an attacker forces a victim to use a known session identifier before login and later reuses that identifier after authentication. The OAuth state value was also not implemented as a dedicated, single-use nonce. This weakened CSRF protections and increased the risk of replay attacks against the OAuth callback process. The authentication flow further failed to enforce HTTPS for the configured OAuth redirect URI. If a non-HTTPS redirect URI was used, OAuth authorization codes and access tokens could traverse the network in plaintext, exposing sensitive credentials to network attackers. Finally, OAuth error responses containing attacker-controlled GET parameters were logged verbatim. An attacker could inject control characters or crafted log content, leading to log forging, log injection, or corruption of audit records. The fix introduces: * A dedicated cryptographically random OAuth state value. * Single-use state validation and invalidation. * Constant-time state comparison using hash_equals(). * Session identifier rotation after successful authentication. * Enforcement of HTTPS-only redirect URIs. * Sanitized and length-limited logging of OAuth error parameters. AAD Authentication Plugin (OAuth 2.0 / Azure Active Directory integration)
- Severity
- high
- Software
- PHP
- Fixed in
- 2.5.42
- Published
- 2026-06-22
Affected versions
Until: 2.5.42
Fixed in: 2.5.42
How to fix this CVE
Upgrade PHP to version 2.5.42 or later to patch critical OAuth 2.0 authentication flaws in the Azure Active Directory integration. This update addresses session fixation, state parameter validation, HTTPS enforcement, and log injection vulnerabilities that could enable session hijacking and credential exposure. Apply the update immediately to all production and staging environments running affected PHP versions.
sudo dnf update phpDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
GET requests to OAuth callback endpoints containing `state` parameters matching PHP session ID patterns (e.g., `state=[a-f0-9]{26}` or `state=PHPSESSID_*`); HTTP Referer headers leaking OAuth authorization codes or session tokens; POST requests to error handlers with unencoded `error` parameters containing newlines or control charactersWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block OAuth callback requests with non-HTTPS origins; reject state parameters that do not match expected random token format; sanitize and truncate error parameters in OAuth error responses to prevent log injection; enforce HTTPS-only redirect URIs and reject HTTP redirects during OAuth flowsHow to check if you are affected
- Run `php -v` to check your current PHP version; CVE-2026-56425 affects versions below 2.5.42
- Check if the Azure Active Directory authentication plugin is installed by running `php -m | grep -i aad` or examining your PHP configuration files in `/etc/php/*/conf.d/`
- Search application logs for OAuth redirect URLs containing session identifiers by grepping for patterns like `state=PHPSESSID` or `oauth.*session` in `/var/log/apache2/access.log` or `/var/log/nginx/access.log`
- After upgrading, verify the fix by running `php -v` again and confirming version 2.5.42 or higher is installed; restart PHP-FPM with `sudo systemctl restart php-fpm` and monitor authentication logs for errors
FAQ
What is CVE-2026-56425?
CVE-2026-56425 is a high-severity vulnerability in PHP's Azure Active Directory OAuth 2.0 implementation that exposes session identifiers in redirect URLs, fails to rotate session tokens, and lacks proper state validation, enabling session hijacking, CSRF attacks, and log injection.
Is CVE-2026-56425 being actively exploited?
No, this vulnerability is not currently listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are available, though the attack vectors are straightforward and organizations should prioritize patching.
What versions of PHP are affected by CVE-2026-56425?
All PHP versions up to and including 2.5.41 are affected; version 2.5.42 and later contain the security fixes.
How do I check if my server is vulnerable to CVE-2026-56425?
Run `php -v` to check your version; if it returns a version lower than 2.5.42, your server is vulnerable. Also verify that the Azure Active Directory authentication module is active by checking `php -m` output or configuration files in `/etc/php/`.
Does Defensia detect CVE-2026-56425?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PHP is installed on a monitored server, CVE-2026-56425 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-56425. Free for 1 server.
Get started free