Projet

Général

Profil

Bug #45581

Lasso fail to properly escape single quotes in RelayState

Ajouté par Emmanuel Dreyfus il y a plus de 3 ans. Mis à jour il y a plus de 2 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
Core
Version cible:
Début:
30 juillet 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

lasso uses libxml2's xmlURIEscapeStr() to URL-encode parameters in query strings. This function implements RFC 2396 URL encoding, which does not mandates escaping the single quote. As a result, lasso produces RelayState parameters with single quotes unescaped in the query string.

Unfortunately, browers automatically replace single quotes in query string by %27. The IdP gets a RelayState where the single quote was replaced by %27, while the signature is based on a RelayState containing an unescaped single quote. This causes the IdP to reject the request because the signature does not match.

The proposed fix in attached patch is to implement RFC 3986 compliant URL encoding, where all characters except the unreserved class [A-Za-z0-9._~-] are escaped. This is done in a lasso_xmlURIEscapeStr() function which is a drop-in replacement for xmlURIEscapeStr()


Fichiers

rfc3986.patch (6,18 ko) rfc3986.patch Emmanuel Dreyfus, 30 juillet 2020 03:25

Révisions associées

Révision 0b742b1f (diff)
Ajouté par Benjamin Dauvergne il y a plus de 3 ans

tools: reimplement xmlURIEscapeStr to respect RFC3986 (#45581)

Bugfix by Emmanuel Dreyfus.

License: MIT

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 3 ans

  • Assigné à mis à Benjamin Dauvergne
#2

Mis à jour par Benjamin Dauvergne il y a plus de 3 ans

I need a statement here that you contribute under MIT license then I will commit your patch with attribution.

#3

Mis à jour par Benjamin Dauvergne il y a plus de 3 ans

  • Statut changé de Nouveau à Solution validée
#4

Mis à jour par Benjamin Dauvergne il y a plus de 3 ans

  • Version cible changé de future à 2.6.2
#5

Mis à jour par Emmanuel Dreyfus il y a plus de 3 ans

I need a statement here that you contribute under MIT license then I will
commit your patch with attribution.

I contribute the patch under MIT license.

#6

Mis à jour par Benjamin Dauvergne il y a plus de 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 390d306e6e87619bd56f766897332d76f81ddd39
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Tue Aug 11 11:30:51 2020 +0200

    tools: reimplement xmlURIEscapeStr to respect RFC3986 (#45581)

    Bugfix by Emmanuel Dreyfus.

    License: MIT
#7

Mis à jour par Benjamin Dauvergne il y a plus de 2 ans

  • Statut changé de Résolu (à déployer) à Fermé

Formats disponibles : Atom PDF