Cannot access property starting with "\0" in SAML2\XML\saml\NameIDType->__unserialize()

Created on 13 March 2024, 9 months ago
Updated 3 July 2024, 6 months ago

Problem/Motivation

With the 4.0.0 or and also the 4.x dev version in combination with simplesamlphp/saml2 versions : * v4.6.11 the following error is logged:

'Error: Cannot access property starting with "\0" in SAML2\XML\saml\NameIDType->__unserialize() (line 252 of /var/www/html/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameIDType.php).'

This also noted in this issue: https://www.drupal.org/project/simplesamlphp_auth/issues/3349278#comment... 📌 4.0.0-alpha1 release compatible with D10/Symfony6 Fixed

When explicitly requiring simplesamlphp/saml2 versions : * v4.6.10 the error is gone.
Changes: https://github.com/simplesamlphp/saml2/compare/v4.6.10...v4.6.11

Remaining tasks

We must work out if a change in the simplesamlphp_auth is needed.

🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

🇳🇱Netherlands Johan den Hollander

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Johan den Hollander
  • 🇳🇱Netherlands roderickgadellaabsl

    We ran into this issue as well. It seems like existing sessions that were created using saml2 <= 4.6.10 can not be parsed by 4.6.11. We used the mysql option to store sessions. A TRUNCATE of the tables fixed it for us.

    (Note: also truncate the Drupal `sessions` table or you end up in an endless redirect loop)

    ```
    --- SimpleSAMLphp database:
    TRUNCATE SimpleSAMLphp_kvstore;
    TRUNCATE SimpleSAMLphp_saml_LogoutStore;

    --- Drupal database:
    TRUNCATE sessions;
    ```

  • 🇨🇭Switzerland berdir Switzerland

    That sounds like a SimpleSAMLphp bug that we can't do anything about.

  • 🇳🇱Netherlands Johan den Hollander

    Thanks @roderickgadellaabsl this seems like a easy way to solve it.
    Will try this with the next release cycle of the website we were having the problem with.

    Although there is nothing that needs fixing in this module, we can leave this here for other people to find it!

  • 🇳🇱Netherlands idebr

    Solution #2 in code:

    drush sql-query "TRUNCATE TABLE sessions"
    drush sql-query "TRUNCATE TABLE simpleSAMLphp_kvstore"
    drush sql-query "TRUNCATE TABLE simpleSAMLphp_saml_LogoutStore"
    
  • Hello,
    I'm experiencing the same.
    SimpleSamlphp is installed with composer as part Drupal

    I looked at my databases/tables:

    I do not have a " SimpleSAMLphp" database.
    and do not have "simpleSAMLphp_kvstore" and "simpleSAMLphp_saml_LogoutStore" tables

    however in the Drupal database, I do have:
    simplesaml_saml_LogoutStore and
    simpleSAMLphp_saml_LogoutStore

    Am I missing something?

  • 🇳🇱Netherlands roderickgadellaabsl

    I do not have a " SimpleSAMLphp" database.

    The tables are (probably) in your Drupal database, not a separate one.

Production build 0.71.5 2024