Skip to content

Encryption method rsa-1.5 must be block-listed #738

Closed
@peppelinux

Description

@peppelinux

Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" must be blacklisted.
At this time it's instead the default one.

Code Version

master branch and previous releases

Expected Behavior

IdP should encrypt the Assertions in the Response using one of the available Encryption Algorithm in the Service Provider Metadata. For example, Shibboleth SP 3 exposes as default these:

      <md:EncryptionMethod Algorithm="http://www.w3.org/2009/xmlenc11#aes128-gcm"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2009/xmlenc11#aes192-gcm"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2009/xmlenc11#aes256-gcm"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2009/xmlenc11#rsa-oaep"/>
      <md:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>

Current Behavior

Digging in pysaml2 I found:

  • saml2.sigver
  • saml2./xml_template/template.xml (used in saml2.sigver.SecurityContext)

In sigver.py we have a default value here:
immagine

In saml2./xml_template/template.xml something more hardcoded:
immagine

Possible Solution

We should:

Steps to Reproduce

pySAML2 IdP encrypts or not the assertion depending by the arguments passed in the method saml2.server.Server.create_authn_response. We should be able to dynamically put encryption if SP have enc cert in its metadata (handled in uniAuth: https://github.com/UniversitaDellaCalabria/uniAuth/blob/7f514798f903ce212c680915f6dbdb22ffd100d8/uniauth/views.py#L472)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions