CVE-2017-12868: SimpleSAMLphp Session Fixation Issue and Authentication Bypass

simplesamlphp/simplesamlphp Updated 02 Oct 2025

Summary

14/05/2022
Yes i
Critical
9.8

CVE-2017-12868: SimpleSAMLphp Session fixation issue and authentication bypass in the authcrypt module. Affects simplesamlphp/simplesamlphp versions >= 1.14.12, < 1.14.14. Fixed in 1.14.14. How to fix ↓

Also tracked for

The same CVE-2017-12868 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

SimpleSAMLphp is an open-source PHP library that provides a set of tools for implementing SAML-based authentication. It is widely used for single sign-on (SSO) solutions and identity federation. The library allows organizations to authenticate users across multiple systems using a single set of credentials. However, SimpleSAMLphp versions 1.14.13 and earlier are vulnerable to a session fixation issue and authentication bypass in the authcrypt module.

Vulnerability Detail

The vulnerability, identified as CVE-2017-12868, stems from a flaw in the secureCompare method within the Crypto.php file of SimpleSAMLphp. When used with PHP versions prior to 5.6, the method fails to perform necessary character conversions before an XOR operation. This oversight enables attackers to exploit session fixation attacks or potentially bypass authentication. By leveraging this vulnerability, an attacker could gain unauthorized access to protected resources or impersonate legitimate users.

How To Fix

Minimum fixed version

1.14.14

This is the first release that contains the fix.

composer require simplesamlphp/simplesamlphp:1.14.14

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented. The workaround involves manually applying the necessary character conversions before the XOR operation in the secureCompare method. Here is an example of the modified code:

// Original code
function secureCompare($a, $b) {
    $result = 0;
    for ($i = 0; $i < strlen($a); $i++) {
        $result |= ord($a[$i]) ^ ord($b[$i]);
    }
    return $result === 0;
}

// Modified code
function secureCompare($a, $b) {
    $result = 0;
    for ($i = 0; $i < strlen($a); $i++) {
        $result |= ord(utf8_encode($a[$i])) ^ ord(utf8_encode($b[$i])));
    }
    return $result === 0;
}

Conclusion

In conclusion, SimpleSAMLphp versions 1.14.13 and earlier are vulnerable to a session fixation issue and authentication bypass. Upgrading to version 1.14.14 or later is the recommended solution to mitigate the risk. If immediate upgrade is not possible, applying the provided workaround can serve as a temporary measure. For further assistance and support in addressing this vulnerability, please contact DevNack.com.

See every vulnerability recorded for simplesamlphp/simplesamlphp →

Share this vulnerability

FAQ

SimpleSAMLphp is an open-source PHP library used for implementing SAML-based authentication and single sign-on solutions.

The vulnerability allows attackers to conduct session fixation attacks or potentially bypass authentication, leading to unauthorized access or impersonation of legitimate users.

Versions 1.14.13 and earlier of SimpleSAMLphp are affected by this vulnerability.

To fix the vulnerability, it is recommended to upgrade SimpleSAMLphp to version 1.14.14 or later.

Yes, a temporary workaround involves manually applying character conversions before the XOR operation in the secureCompare method. Refer to the 'workaround' section for more details.

Related vulnerabilities

Recent vulnerabilities recorded for simplesamlphp/simplesamlphp.

How To Fix

Minimum fixed version

1.14.14

This is the first release that contains the fix.

composer require simplesamlphp/simplesamlphp:1.14.14

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback