Skip to content

Commit 59604b6

Browse files
fix: saml2.assertion: safeguard _filter_values against vals=None
In certain circumstances, such as an Saml2IdP receiving a request from an SP where the SP metadata has a RequestedAttribute with specific values, `_filter_values` may be called with vals=None when processing the AuthnRequest. Safeguard against this by returning early, returning the None value unfiltered. (It will get later replaced with an [] in `_apply_attr_value_restrictions`).
1 parent 65674f8 commit 59604b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/saml2/assertion.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def _filter_values(vals, vlist=None, must=False):
3535
if not vlist: # No value specified equals any value
3636
return vals
3737

38+
if vals is None: # cannot iterate over None, return early
39+
return vals
40+
3841
if isinstance(vlist, six.string_types):
3942
vlist = [vlist]
4043

0 commit comments

Comments
 (0)