Skip to content

Parsing of SAML ticket crashes on attributes with no value #75

Description

@gollux

When CASClientWithSAMLV1 is verifying a ticket, which contains an <Attribute> element with no <AttributeValue>, the verify_ticket function crashes in the following piece of code:

                    values = at.findall(SAML_1_0_ASSERTION_NS + 'AttributeValue')
                    if len(values) > 1:
                        values_array = []
                        for v in values:
                            values_array.append(v.text)
                            attributes[at.attrib['AttributeName']] = values_array
                    else:
                        attributes[at.attrib['AttributeName']] = values[0].text

A brief examination of the SAML 1.0 specification confirms that attributes with no <AttributeValue> are indeed valid.

What is the proper way of handling such attributes? Ignoring them completely? Or parsing them with an empty list as their value?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions