Skip to content
Snippets Groups Projects
Unverified Commit 83b67d2a authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Conform SAML2INT; check AuthnReqsignature unless specifically disabled (#1440)

* Conform SAML2INT; check AuthnRequest signature unless specifically disabled
parent 0b861789
No related branches found
No related tags found
No related merge requests found
...@@ -355,6 +355,11 @@ The following SAML 2.0 options are available: ...@@ -355,6 +355,11 @@ The following SAML 2.0 options are available:
`validate.authnrequest` `validate.authnrequest`
: Whether we require signatures on authentication requests sent to this IdP. : Whether we require signatures on authentication requests sent to this IdP.
Set it to:
true: authnrequest must be signed (and signature will be validated)
null: authnrequest may be signed, if it is, signature will be validated
false: authnrequest signature is never checked
: Note that this option also exists in the SP-remote metadata, and : Note that this option also exists in the SP-remote metadata, and
any value in the SP-remote metadata overrides the one configured any value in the SP-remote metadata overrides the one configured
......
...@@ -296,6 +296,11 @@ The following options can be set: ...@@ -296,6 +296,11 @@ The following options can be set:
`validate.authnrequest` `validate.authnrequest`
: Whether we require signatures on authentication requests sent from this SP. : Whether we require signatures on authentication requests sent from this SP.
Set it to:
true: authnrequest must be signed (and signature will be validated)
null: authnrequest may be signed, if it is, signature will be validated
false: authnrequest signature is never checked
: Note that this option also exists in the IdP-hosted metadata. : Note that this option also exists in the IdP-hosted metadata.
The value in the SP-remote metadata overrides the value in the IdP-hosted metadata. The value in the SP-remote metadata overrides the value in the IdP-hosted metadata.
......
...@@ -13,6 +13,7 @@ Upgrade notes for SimpleSAMLphp 2.0 ...@@ -13,6 +13,7 @@ Upgrade notes for SimpleSAMLphp 2.0
- If you're using the core:TargetedID authproc-filter, note that the `attributename` setting has been renamed to `identifyingAttribute`. - If you're using the core:TargetedID authproc-filter, note that the `attributename` setting has been renamed to `identifyingAttribute`.
- The default encryption algorithm is set from AES128_CBC to AES128_GCM. If you're upgrading from an existing implementation, you may want - The default encryption algorithm is set from AES128_CBC to AES128_GCM. If you're upgrading from an existing implementation, you may want
to manually switch back the `sharedkey_algorithm`. Note that CBC is vulnerable to the Padding oracle attack. to manually switch back the `sharedkey_algorithm`. Note that CBC is vulnerable to the Padding oracle attack.
- In compliancy with SAML2INT, AuthnRequests that are signed will have their signature validated unless specifically disabled by setting `validate.authnrequest` to `false`. If unset, or set to true, signatures will be validated and requests not passing validation will be refused.
- The following classes have been migrated to non-static: - The following classes have been migrated to non-static:
+ lib/SimpleSAMLphp\Utils\Arrays + lib/SimpleSAMLphp\Utils\Arrays
+ lib/SimpleSAMLphp\Utils\Attributes + lib/SimpleSAMLphp\Utils\Attributes
......
...@@ -213,7 +213,14 @@ class Message ...@@ -213,7 +213,14 @@ class Message
} }
} }
if ($enabled === null) { // If not specifically set to false, the signature must be checked to conform to SAML2INT
if (
(isset($_REQUEST['Signature'])
|| $message->isMessageConstructedWithSignature() === true)
&& ($enabled !== false)
) {
$enabled = true;
} elseif ($enabled === null) {
$enabled = $srcMetadata->getBoolean('redirect.validate', null); $enabled = $srcMetadata->getBoolean('redirect.validate', null);
if ($enabled === null) { if ($enabled === null) {
$enabled = $dstMetadata->getBoolean('redirect.validate', false); $enabled = $dstMetadata->getBoolean('redirect.validate', false);
...@@ -222,9 +229,7 @@ class Message ...@@ -222,9 +229,7 @@ class Message
if (!$enabled) { if (!$enabled) {
return; return;
} } elseif (!self::checkSign($srcMetadata, $message)) {
if (!self::checkSign($srcMetadata, $message)) {
throw new SSP_Error\Exception( throw new SSP_Error\Exception(
'Validation of received messages enabled, but no signature found on message.' 'Validation of received messages enabled, but no signature found on message.'
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment