Skip to content

Fix confusion of the root-node when validating a signature - #424

Open
tvdijen wants to merge 2 commits into
masterfrom
bugfix/signature-root-confusion
Open

Fix confusion of the root-node when validating a signature#424
tvdijen wants to merge 2 commits into
masterfrom
bugfix/signature-root-confusion

Conversation

@tvdijen

@tvdijentvdijen commented Aug 13, 2026

Copy link
Copy Markdown
Member

When unmarshalling an unsigned response containing a signed assertion, the validation of the assertion's signature fails.
This is because of the document we pull in this line of code:
https://github.com/simplesamlphp/xml-security/blob/master/src/XML/SignedElementTrait.php#L139

.. and because of what we pass to Assertion::setXML().
Before this change we would pass the entire Response instead of just the Assertion. And because the Response is unsigned, the XPath-query child::ds:Signature yields no result, failing to pass the minCount-assertion.

Verified this using var_dump($xml->ownerDocument->documentElement->localName); after the referenced line 139. Before this change it returned Response and after it shows Assertion

@tvdijen
tvdijen marked this pull request as ready for review August 15, 2026 13:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@tvdijen