79% vs 51%: independent neobanks lag on app security. Read the report

Deep Dive

Deep Dive

SimpleSAMLphp SAML2 Signature Bypass via Test Key (CVE-2026-142239)

saml2 verified HTTP-Redirect signatures against a bundled test key whose private half is public, so anyone could forge signed SAML messages. Fixed in 6.3.5.

TL;DR

  • The simplesamlphp/saml2 library checked HTTP-Redirect signatures against a test public key that ships in its xml-security dependency, and the matching private key ships too. VulnCheck rates CVE-2026-142239 CVSS v4.0 9.1 Critical.
  • Applications that rely on the library's HTTP-Redirect binding to verify signed SAMLRequest or SAMLResponse messages are affected. Affected ranges: 5.0.0 to 5.0.13, 6.0.0 to 6.1.10, 6.2.0 to 6.2.8, 6.3.0 to 6.3.4 and 7.0.0-rc1 to 7.0.0-rc5.
  • No in-the-wild exploitation is reported, and CVE-2026-142239 is not in CISA KEV as of 2026-12-03. No exploit script is published, but the private key needed to sign a forged message is in the public package.
  • Upgrade to 5.0.14, 6.1.11, 6.2.9, 6.3.5 or 7.0.0-rc6. SimpleSAMLphp 2.4.12 and 2.5.5 ship the fixed library. "How do I fix it?" covers the fail-closed behaviour and the interim check.

Am I affected?

All of these must hold:

  • Your application depends on simplesamlphp/saml2 in an affected range.
  • It receives SAML messages over the HTTP-Redirect binding and calls Binding::getCurrentBinding()->receive() or HTTPRedirect::receive().
  • It relies on that call to verify the message signature, rather than verifying the signature itself against the peer's metadata.
  • It acts on a message type an attacker can forge, such as an AuthnRequest, LogoutRequest or LogoutResponse.

The advisory says a consumer that verifies signatures itself is not bypassed. The flaw is in the binding's own check, so a later check against the peer's metadata still rejects a signature made with the test key.

Branch Affected versions Fixed version
5.x 5.0.0 to 5.0.13 5.0.14
6.0.x 6.0.0 to 6.1.10 6.1.11
6.2.x 6.2.0 to 6.2.8 6.2.9
6.3.x 6.3.0 to 6.3.4 6.3.5
7.0.0 pre-releases 7.0.0-rc1 to 7.0.0-rc5 7.0.0-rc6

The GitHub advisory lists 6.1.10 as patched, but the v6.1.10 tag still contains the test-key call at src/Binding/HTTPRedirect.php line 205. The v6.1.11 tag replaces it, and the CVE record names 6.1.11 as the fixed release.

SimpleSAMLphp 2.4.1 to 2.4.11 and 2.5.0 to 2.5.4 bundle affected saml2 releases. SimpleSAMLphp 2.4.12 locks saml2 5.0.14, and 2.5.5 locks 6.3.5.

Check the library version and the code that calls the binding:

composer show simplesamlphp/saml2
composer show simplesamlphp/simplesamlphp
grep -n '"simplesamlphp/saml2"' composer.lock
grep -rn "getCurrentBinding\|HTTPRedirect" --include='*.php' .

For a SimpleSAMLphp installation, composer show reads the lock file. If the site was installed from a release archive, check vendor/composer/installed.json or the release notes instead.

How do I fix it?

Upgrade the library, and the product that embeds it.

  1. In a project that requires simplesamlphp/saml2 directly, run composer require simplesamlphp/saml2:^6.3.5 and then composer update simplesamlphp/saml2 --with-dependencies. Use ^6.1.11 on the 6.0.x/6.1.x line, ^6.2.9 on the 6.2.x line, ^5.0.14 on the 5.x line, and 7.0.0-rc6 on the 7.0.0 pre-release line.
  2. In a SimpleSAMLphp 2.5 installation, upgrade to 2.5.5. In a 2.4 LTS installation, upgrade to 2.4.12. Both releases update the bundled library.
  3. Run composer show simplesamlphp/saml2 and confirm the installed version is 5.0.14 or later, 6.1.11 or later, 6.2.9 or later, 6.3.5 or later, or 7.0.0-rc6 or later.
  4. Test a signed AuthnRequest and a signed LogoutRequest through the HTTP-Redirect binding. The fixed binding fails closed when the container supplies no peer keys, so a version check alone can miss a functional break.

The fix changes the binding's contract: it calls getPublicSigningKeysForEntity() on the container. The base container returns an empty array, and the binding then throws SignatureVerificationFailedException('Failed to verify signature. No keys.'). A consumer must implement that method with the peer's metadata signing keys, or keep verifying the signature in its own code. That is the intended fail-closed behaviour, not a second vulnerability.

If you cannot upgrade, verify the signature yourself after receive() against the peer's metadata signing keys, as the advisory recommends. The check must cover every signed HTTP-Redirect message type the application accepts.

It must use the same signed query string the binding built: the SAMLRequest or SAMLResponse parameter, an optional RelayState, and SigAlg. A check that only covers AuthnRequests leaves LogoutRequests exposed. Upgrading is the only fix that removes the test-key path.

What is the root cause?

HTTPRedirect::receive() builds the signed query string from the request, then verifies the Signature parameter with a key loaded from SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock. That class is a test helper, but it is part of the runtime package, and its key files are installed with it.

The vulnerable block is src/Binding/HTTPRedirect.php lines 199 to 209 at tag v6.2.4:

$container = ContainerSingleton::getInstance();
$blacklist = $container->getBlacklistedEncryptionAlgorithms();
$verifier = (new SignatureAlgorithmFactory($blacklist))->getAlgorithm(
    $query['SigAlg'],
    // TODO:  Need to use the key from the metadata
    PEMCertificatesMock::getPublicKey(PEMCertificatesMock::SELFSIGNED_PUBLIC_KEY),
);

if ($verifier->verify($signedQuery, base64_decode($query['Signature'])) === false) {
    throw new SignatureVerificationFailedException('Failed to verify signature.');
}

$query holds the request's query parameters. $signedQuery is the exact string the sender signed: the SAMLRequest or SAMLResponse parameter, an optional RelayState, and SigAlg. SignatureAlgorithmFactory builds a verifier for the algorithm in SigAlg, and verify() compares the signature with $signedQuery. The key passed to the factory is the problem. PEMCertificatesMock::getPublicKey(PEMCertificatesMock::SELFSIGNED_PUBLIC_KEY) loads resources/keys/selfsigned.simplesamlphp.org.pub from the simplesamlphp/xml-security package.

The matching private key is in the same package at resources/keys/selfsigned.simplesamlphp.org.key. PEMCertificatesMock::getPrivateKey() loads it with the passphrase 1234, which is also a constant in the class. The xml-security .gitattributes does not export-ignore resources/ or src/TestUtils/, so Composer installs both files. Anyone who downloads the package has both halves of the keypair.

The TODO comment records the intended fix: use the key from the metadata. The code instead used the test key, so a signature made with the published private key passed, and a signature made with the real peer's key failed.

The check has been in the 5.x line since the 5.0.0 release on 2025-12-17. It originated in commit 5f55f198 ("Partially fix HTTPRedirect") on 2022-11-05 and reached the release line through the 5.0.0 branch.

The advisory credits Zachariah Mithani (AploSec), kta1kri, manus-pi, gosusnkr, manus-use and ucsurf.

The test-key check shipped in saml2 5.0.0 on December 17, 2025, and the fix landed on November 24, 2026
Figure 1: From the first affected release to the fix, the SimpleSAMLphp releases and the CVE record. Source: saml2 git history, GitHub releases and the CVE record, checked December 3, 2026

How is it exploited?

The attacker uses the published private key to sign a message that the binding will accept as verified.

  1. Read the test private key from vendor/simplesamlphp/xml-security/resources/keys/selfsigned.simplesamlphp.org.key, or from the public repository.
  2. Build the SAML message the application acts on, such as a LogoutRequest for a chosen subject or an AuthnRequest naming a trusted SP.
  3. Deflate and base64-encode the message, build the signed query string in the binding's order, and sign it with the test private key.
  4. Send the query string to the endpoint that uses the HTTP-Redirect binding.
  5. HTTPRedirect::receive() loads the test public key, verifies the attacker's signature and returns the message as verified.
  6. The application processes the forged request. An IdP can be made to log out any subject or to treat an AuthnRequest as coming from a trusted SP. An SP can be made to accept a forged LogoutRequest or LogoutResponse.

No exploit script is published, and the advisory does not include one. The private key is the only missing piece for an attacker, and it is in the package.

How does the attack flow?

The attacker signs with the published test private key, and the binding verifies with the matching test public key instead of the peer's metadata key.

flowchart LR A["Attacker reads the bundled test private key"] --> B["Builds a SAMLRequest or SAMLResponse"] B --> C["Signs the query string with the test key"] C --> D["HTTPRedirect::receive() loads the test public key"] D --> E["Signature passes; no peer metadata key check"] E --> F["Forged message returned as verified"] F --> G["Logout or request forgery at the peer"]

What can an attacker do?

An unauthenticated attacker who can reach the endpoint can have a forged SAML message accepted as correctly signed.

The impact depends on the message the application accepts. The advisory names these cases:

  • At an IdP, a forged signed LogoutRequest can log out any subject, and a forged signed AuthnRequest can be attributed to a trusted SP.
  • At an SP, a forged signed LogoutRequest or LogoutResponse can end a session or forge a logout result.

The advisory does not demonstrate code execution, and it does not describe a forged Response that logs in as another user. The CVSS v4.0 vector is CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N. It describes network reach, no privileges, no user interaction and high confidentiality and integrity impact. The AT:P precondition is that the consumer relies on the binding's signature check.

The conditions are all of the following: the endpoint uses the HTTP-Redirect binding, it relies on receive() for signature verification, and it acts on the forged message type. An application that verifies the signature itself against the peer's metadata is not bypassed, the advisory says.

Why does the fix work?

The fix takes the signing keys from the message issuer's metadata and refuses to verify when no key is available.

-        $blacklist = $container->getBlacklistedEncryptionAlgorithms();
-        $verifier = (new SignatureAlgorithmFactory($blacklist))->getAlgorithm(
-            $query['SigAlg'],
-            // TODO:  Need to use the key from the metadata
-            PEMCertificatesMock::getPublicKey(PEMCertificatesMock::SELFSIGNED_PUBLIC_KEY),
-        );
+        $blacklist = $container->getBlacklistedSignatureAlgorithms();
+        $signatureAlgo = new SignatureAlgorithmFactory($blacklist);
+
+        $signingEntity = $message->getIssuer()?->getContent()->getValue();
+        $keys = $container->getPublicSigningKeysForEntity($signingEntity);
+
+        $verifiedCount = 0;
+
+        foreach ($keys as $k) {
+            $verifier = $signatureAlgo->getAlgorithm(urldecode($query['SigAlg']), $k);
+
+            if ($verifier->verify($signedQuery, base64_decode(urldecode($query['Signature']))) === false) {
+                throw new SignatureVerificationFailedException('Failed to verify signature.');
+            }
+            $verifiedCount++;
+        }
+        if (count($keys) === 0) {
+            throw new SignatureVerificationFailedException('Failed to verify signature. No keys.');
+        }
+        if ($verifiedCount !== count($keys)) {
+            throw new SignatureVerificationFailedException('Failed to verify all signatures.');
+        }

The diff is from commit 7f3182e. The fix reads the issuer from the parsed message, asks the container for that entity's public signing keys, and verifies the signature against each key. If the container returns no keys, it throws instead of falling back to a built-in key. The getBlacklistedSignatureAlgorithms() call also replaces the encryption-algorithm blacklist with the signature-algorithm blacklist.

The fix is complete for the library's own check. The base container returns an empty array, so a consumer that does not implement getPublicSigningKeysForEntity() now fails closed. That is deliberate: a missing metadata key must stop the message, not accept a test key. A consumer that wants signed HTTP-Redirect messages to keep working must supply the peer's keys through the container.

How do I check if I was compromised?

No indicators of compromise are published for this flaw. The test key is not tied to a deployment, so a forged message can look like a normal signed message in a log.

Find the log file your deployment configures for SimpleSAMLphp. Search it for logout and binding activity:

grep -Ei "LogoutRequest|LogoutResponse|SAMLRequest|SAMLResponse" /var/log/simplesamlphp/simplesamlphp.log

Look for logout events for subjects who did not request one, and for AuthnRequests attributed to a trusted SP at unexpected times. If the application also verified the signature itself, a rejected forgery may appear as a SignatureVerificationFailedException or an "Unable to validate signature" error. That is a lead, not proof of a successful bypass.

A successful forgery leaves no distinctive file, process or network indicator in the advisory. If the endpoint relied on the binding and accepted a forged message, the application's own logs are the only place to look. An attempt that failed before reaching the binding may leave no trace at all.

Timeline

  • 2025-12-17: simplesamlphp/saml2 5.0.0 was released with the test-key check in HTTPRedirect::receive().
  • 2026-11-24: The advisory was published, and commits 7f3182e and 435036e replaced the test key with the container's metadata keys. Tags v5.0.14, v6.1.11, v6.2.9, v6.3.5 and v7.0.0-rc6 followed.
  • 2026-11-25: SimpleSAMLphp 2.4.12 and 2.5.5 shipped the fixed library.
  • 2026-12-02: VulnCheck published CVE-2026-142239. No in-the-wild exploitation was reported, and the CISA KEV catalog version 2026.11.30 does not list it.

FAQ

Is CVE-2026-142239 exploited in the wild?

No exploitation was reported as of 2026-12-03. The CVE is not in CISA KEV, and the advisory does not mention attacks.

Is there a public proof of concept?

No exploit script is published. The private half of the test key is in the public xml-security package, so anyone can produce a signature that passes the vulnerable check.

Which versions are fixed?

5.0.14, 6.1.11, 6.2.9, 6.3.5 and 7.0.0-rc6. The GitHub advisory lists 6.1.10 as patched, but v6.1.10 still contains the test-key call; use 6.1.11.

Does the fix break signed HTTP-Redirect messages?

It can, if the application's container does not implement getPublicSigningKeysForEntity(). The base container returns an empty array, so the fixed binding fails closed. Supply the peer's metadata signing keys or keep verifying in the application.

Can I work around it without upgrading?

Yes, by verifying the signature yourself against the peer's metadata after receive(). Cover every signed message type the endpoint accepts, and use the same signed query string. Upgrading is safer because it removes the test-key path.

Does this affect SimpleSAMLphp itself?

The affected component is the saml2 library; SimpleSAMLphp 2.4.1 to 2.4.11 and 2.5.0 to 2.5.4 bundle it. SimpleSAMLphp's own message validation checks signatures against metadata, which the advisory says is not bypassed, but upgrade to 2.4.12 or 2.5.5 to remove the vulnerable library.

References

  • SimpleSAMLphp saml2 advisory: https://github.com/simplesamlphp/saml2/security/advisories/GHSA-h8fv-vm7c-r6fh (checked December 3, 2026)
  • CVE-2026-142239 record: https://www.cve.org/CVERecord?id=CVE-2026-142239 (checked December 3, 2026)
  • Vulnerable source at v6.2.4: https://github.com/simplesamlphp/saml2/blob/v6.2.4/src/Binding/HTTPRedirect.php (checked December 3, 2026)
  • Fix commit 7f3182e: https://github.com/simplesamlphp/saml2/commit/7f3182e43dd5cc25a44f3f334053f895b5016a22 (checked December 3, 2026)
  • Fix commit 435036e: https://github.com/simplesamlphp/saml2/commit/435036e16d00773caae63cee76e74362bf6ec31e (checked December 3, 2026)
  • saml2 v6.3.5 release: https://github.com/simplesamlphp/saml2/releases/tag/v6.3.5 (checked December 3, 2026)
  • saml2 v5.0.14 release: https://github.com/simplesamlphp/saml2/releases/tag/v5.0.14 (checked December 3, 2026)
  • SimpleSAMLphp 2.5.5 release: https://github.com/simplesamlphp/simplesamlphp/releases/tag/v2.5.5 (checked December 3, 2026)
  • SimpleSAMLphp 2.4.12 release: https://github.com/simplesamlphp/simplesamlphp/releases/tag/v2.4.12 (checked December 3, 2026)
  • PEMCertificatesMock at xml-security v2.3.2: https://github.com/simplesamlphp/xml-security/blob/v2.3.2/src/TestUtils/PEMCertificatesMock.php (checked December 3, 2026)
  • Test private key at xml-security v2.3.2: https://github.com/simplesamlphp/xml-security/blob/v2.3.2/resources/keys/selfsigned.simplesamlphp.org.key (checked December 3, 2026)
  • VulnCheck advisory: https://www.vulncheck.com/advisories/simplesamlphp-saml2-before-5.0.14-6.1.11-6.2.9-6.3.5-7.0.0-rc6-signature-bypass (checked December 3, 2026)
  • Packagist downloads: https://packagist.org/packages/simplesamlphp/saml2 (checked December 3, 2026)
  • CISA KEV catalog: https://www.cisa.gov/known-exploited-vulnerabilities-catalog (checked December 3, 2026)
  • Introduction commit 5f55f198: https://github.com/simplesamlphp/saml2/commit/5f55f198bd0b66f2e23d26d631c92615625de8b6 (checked December 3, 2026)
  • saml2 v5.0.0 release: https://github.com/simplesamlphp/saml2/releases/tag/v5.0.0 (checked December 3, 2026)

Free scan

Scan your own app for free

or book a demo

Keep reading

Related articles

Browse the blog