simplesamlphp/simplesamlphp

CVE-2016-9955

CVE-2016-9955 is a medium-severity improper input validation vulnerability in simplesamlphp/simplesamlphp (composer), affecting versions < 1.14.11. It is fixed in 1.14.11.

Key facts
CVSS score
6.3
Medium
Attack vector
Local
Issuing authority
GitHub Advisory Database
Affected package
simplesamlphp/simplesamlphp
Fixed in
1.14.11
Disclosed
2016

Summary

Background An incorrect check of return values in the signature validation utilities allows an attacker to get invalid signatures accepted as valid by forcing an error during validation. Description The SimpleSAMLXMLValidator class allows the verification of the XML digital signature of a SAML 1 message with a given key. In particular, the constructor of the class receives an XML node and a key to verify it and throws an exception in case there is an error, either caused by incorrect input or an invalid signature. This method uses the verify() method from the RobRichards\XMLSecDSig class to verify the signature with the given key, which in turn will end up calling opensslverify() depending on the signature algorithm used. The opensslverify() function returns 1 when the signature was successfully verified, 0 if it failed to verify with the given key and -1 in case an error occurs. PHP allows translating numerical values to boolean implicitly, with the following correspondences: 0 equals false Non-zero equals true This means that an implicit conversion to boolean of the values returned by opensslverify() will convert an error state, signaled by the value -1, to successful verification of the signature (represented by the boolean true). The aforementioned constructor was performing an implicit conversion to boolean of the values returned by the verify() method, which subsequently will return the same output as opensslverify() under most circumstances. This means an error during signature verification is treated as a successful verification by the method. Affected versions All SimpleSAMLphp versions prior to 1.14.11. 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 1 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, SAML 1.1 metadata must be registered by the vulnerable Service Provider for the Identity Provider targeted by the attacker (in metadata/shib13-idp-remote.php), and 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. Credit This security issue was discovered and reported on December 3, 2016 by Thijs Kinkhorst.

Impact

What is improper input validation?

The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths. Typical impact: varies by context: data corruption, logic bypass, or denial of service.

Severity and exposure

CVE-2016-9955 has a CVSS score of 6.3 (Medium). The vector is requires local access, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (1.14.11). Upgrading removes the vulnerable code path.

Affected versions

composer

  • simplesamlphp/simplesamlphp (< 1.14.11)

Security releases

  • simplesamlphp/simplesamlphp → 1.14.11 (composer)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2016-9955 is reachable in your applications. Explore open-source security for your team.

See if CVE-2016-9955 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2016-9955 in your environment

Remediation advice

Upgrade simplesamlphp/simplesamlphp to 1.14.11 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2016-9955

What is CVE-2016-9955?

CVE-2016-9955 is a medium-severity improper input validation vulnerability in simplesamlphp/simplesamlphp (composer), affecting versions < 1.14.11. It is fixed in 1.14.11. The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths.

How severe is CVE-2016-9955?

CVE-2016-9955 has a CVSS score of 6.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of simplesamlphp/simplesamlphp are affected by CVE-2016-9955?

simplesamlphp/simplesamlphp (composer) versions < 1.14.11 is affected.

Is there a fix for CVE-2016-9955?

Yes. CVE-2016-9955 is fixed in 1.14.11. Upgrade to this version or later.

Is CVE-2016-9955 exploitable, and should I be worried?

Whether CVE-2016-9955 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2016-9955 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2016-9955?

Upgrade simplesamlphp/simplesamlphp to 1.14.11 or later.

Stop the waste.
Protect your environment with Kodem.