Skip to content

Incorrect signature verification

Moderate
jaimeperez published GHSA-62c2-r76c-55pp Jun 5, 2019 · 1 comment

Package

composer simplesamlphp/saml2 (Composer)

Affected versions

< 1.9.1, < 1.10.3, < 2.3.3

Patched versions

>= 1.9.1, >= 1.10.3, >= 2.3.3

Description

Impact

Upon successful exploitation, an invalid signature would be regarded as valid by an affected version of the software. This allows attackers to modify or manually craft SAML response messages and, by triggering a signature validation error in the affected party, get those messages accepted as valid and coming from a trusted entity. In practice, this means full capabilities to impersonate any individual at a given service provider.

The issue can be exploited to get other invalid messages accepted as valid, though the security implications there are minor.

In order to exploit the issue, an incorrect context must be fed to the signature validation routines, or an exceptional error must be triggered. So far, the following cases have been identified:

  • Using a DSA public key to validate an XML signature made with an RSA-related algorithm.
  • Using an RSA public key to validate an XML signature made with a DSA-related algorithm.
  • Exhausting available memory while verifying the signature.

SimpleSAMLphp does not support DSA signatures or keys. Therefore, it is not possible for an attacker to feed an incorrect context by sending a signature with an incorrect algorithm. Upon reception of a DSA-SHA1 signature, SimpleSAMLphp will refuse to perform the validation due to the algorithm not being supported. On the other hand, if an attacker manages to trick a service provider operator to change the public key associated to a certain IdP to a DSA key, signatures made with any combination of the RSA algorithm will be accepted, regardless of whether they are valid or not. This means some serious misconfiguration or social engineering is needed in this case for a successful attack.

Regarding memory exhaustion, it is in theory possible to attack a service provider causing the consumption of all available memory while a message with an invalid signature is being validated. However, memory exhaustion must happen only during signature validation and not immediately before or after. This means exploitation of this case is extremely difficult due to the small time window available for the attacker and the precise control that is needed over the service provider.

All in all, the consequences of this issue are critical, so even though we consider it difficult to exploit, and considering that other ways to trigger failures in signature validation could be possible but so far unidentified, we recommend updating the affected software as soon as possible.

Resolution

Upgrade to the latest version.

Severity

Moderate

CVE ID

CVE-2016-9814

Weaknesses

No CWEs