17. November 2009 - 18:47
SimpleSAMLphp und Suhosin
Letztens musste ich SimpleSAMLphp als SP/IdP für mein lokales SSO Entwicklungssystem aufsetzen. Allerdings wollte der SSO Vorgang nicht recht funktionieren.
Nach einigem Stochern in den Logs bin ich auf folgendes gestoßen:
flo@acer ~ $ tail -f /var/log/apache2/error.log ... [Sun Nov 15 15:41:52 2009] [error] [client 127.0.0.1] ALERT - configured GET variable value length limit exceeded - dropped variable 'SAMLRequest' (attacker '127.0.0.1', file '/var/www/simplesaml/saml2/idp/SSOService.php'), referer: http://sp-ssphp.localhost/simplesaml/saml2/sp/idpdisco.php?entityID=http%3A%2F%2Fsp-ssphp.localhost%2Fsimplesaml%2Fsaml2%2Fsp%2Fmetadata.php&return=http%3A%2F%2Fsp-ssphp.localhost%2Fsimplesaml%2Fsaml2%2Fsp%2FinitSSO.php%3FRelayState%3Dhttp%253A%252F%252Fsp-ssphp.localhost%252Fsimplesaml%252Fexample-simple%252Fsaml2-example.php&returnIDParam=idpentityid
Die Logmeldung weißt auf einen Verstoß gegen die Suhosin Richtlinen für die maximale Parameterelänge hin. Da die SAML2 Nachricht “vorneherum” via GET Variable übertragen wird ergibt sich ein recht ansehnliche Parameterlänge, welche von Suhosin als Angriff gewertet und geblockt wird.
Um das Problem zu beheben muss einfach die maximale Parameterlänge in der /etc/php5/conf.d/suhosin.ini erhöht werden. Eine Erhöhung von 512 auf 1024 hat in meinem Fall ausgereicht:
flo@acer ~ $ cat /etc/php5/conf.d/suhosin.ini ... ;suhosin.get.max_value_length = 512 suhosin.get.max_value_length = 1024 ...
Viel Spass!
Nachtrag
Folgendes muss auch noch angepasst werden:
flo@acer ~ $ cat /etc/php5/conf.d/suhosin.ini ... ;suhosin.cookie.max_name_length = 64 suhosin.cookie.max_name_length = 128 ...


Kommentare: