Skip to content

Commit 9bc631b

Browse files
committed
Explicitly deny signatures containing ds:Object elements (E91)
1 parent 6179809 commit 9bc631b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/XML/SignedElementTrait.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ protected function setSignature(Signature $signature): void
4646
ReferenceValidationFailedException::class,
4747
);
4848

49+
/**
50+
* E91: Disallow <ds:Object> element in signatures
51+
*
52+
* The <ds:Object> element is not defined for use with SAML signatures, and SHOULD NOT be present.
53+
*/
54+
55+
Assert::isEmpty(
56+
$signature->getObjects(),
57+
ProtocolViolationException::class,
58+
'The <ds:Object> element is not defined for use with SAML signatures, and SHOULD NOT be present.',
59+
);
60+
4961
$this->signature = $signature;
5062
}
5163

0 commit comments

Comments
 (0)