GHSA-9wrw-p9rm-r782: Onelogin/php saml Onelogin/php-saml Improper Signature Validation On Vulnerability

LOW
Published
Advisory Summary

GHSA-9wrw-p9rm-r782 is a LOW onelogin/php-saml improper signature validation on vulnerability (General Security Weakness) affecting Onelogin/php saml libraries in the Packagist ecosystem. The issue involves onelogin/php-saml improper signature validation on logoutrequest/logoutresponse.. Remediation is available by upgrading affected packages to version 2.10.4.

GHSA-9wrw-p9rm-r782 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-9wrw-p9rm-r782
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Onelogin/php saml
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-9wrw-p9rm-r782

To remediate this vulnerability, upgrade all affected Onelogin/php saml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

onelogin/php-saml fixed: 2.10.4
Upgrade onelogin/php-saml to 2.10.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for onelogin/php-saml

How to Check if You Are Affected

To determine whether your application is affected by GHSA-9wrw-p9rm-r782, inspect your project dependencies for Onelogin/php saml:

inspect dependencies for onelogin/php-saml

Analyze the terminal output to locate any version of Onelogin/php saml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Onelogin/php saml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In order to verify Signatures on Logoutrequests and LogoutResponses we use the verifySignature of the class XMLSecurityKey from the xmlseclibs library. That method end up calling openssl_verify() depending on the signature algorithm used. The openssl_verify() 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 openssl_verify() will convert an error state, signaled by the value -1, to a successful verification of the signature (represented by the boolean true). The LogoutRequest/LogoutResponse signature validator was performing an implicit conversion to boolean of the values returned by the verify() method, which subsequently will return the same output as openssl_verify() under most circumstances. This means an error during signature verification is treated as a successful verification by the method. Since the signature validation of SAMLResponses were not affected, the impact of this security vulnerability is lower, but an update of the php-saml toolkit is recommended.

GHSA-9wrw-p9rm-r782 Affected Onelogin/php saml Versions

1 component(s)
Fixed Versions:
2.10.4
Product / Package Ecosystem Affected Versions Fixed Version
onelogin/php-saml
Packagist
< 2.10.4
2.10.4

References

Frequently Asked Questions

What is GHSA-9wrw-p9rm-r782?
GHSA-9wrw-p9rm-r782 is a security vulnerability in Onelogin/php saml involving onelogin/php-saml Improper signature validation on LogoutRequest/LogoutResponse. under General Security Weakness.
Which Onelogin/php saml versions are affected?
Affected versions include releases prior to 2.10.4 across affected packages: onelogin/php-saml.
What version fixes GHSA-9wrw-p9rm-r782?
Upgrading to 2.10.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is onelogin/php-saml affected?
Yes, onelogin/php-saml is affected in releases prior to 2.10.4. Upgrade your dependency to 2.10.4 or later.
What CWE is associated with GHSA-9wrw-p9rm-r782?
GHSA-9wrw-p9rm-r782 is classified under General Security Weakness.
How can I check Packagist dependencies for GHSA-9wrw-p9rm-r782?
Run the dependency tree command: 'inspect dependencies for onelogin/php-saml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9wrw-p9rm-r782",
  "modified" : "2024-05-17T23:06:54Z",
  "published" : "2024-05-17T23:06:54Z",
  "aliases" : [ ],
  "summary" : "onelogin/php-saml Improper signature validation on LogoutRequest/LogoutResponse.",
  "details" : "In order to verify Signatures on Logoutrequests and LogoutResponses we use\nthe verifySignature of the class XMLSecurityKey from the xmlseclibs library.\nThat method end up calling openssl_verify() depending on the signature algorithm used.\n\nThe openssl_verify() function returns 1 when the signature was successfully verified,\n0 if it failed to verify with the given key, and -1 in case an error occurs.\nPHP allows translating numerical values to boolean implicitly, with the following correspondences:\n- 0 equals false.\n- Non-zero equals true.\n\nThis means that an implicit conversion to boolean of the values returned by openssl_verify()\nwill convert an error state, signaled by the value -1, to a successful verification of the\nsignature (represented by the boolean true).\n\nThe LogoutRequest/LogoutResponse signature validator was performing an implicit conversion to boolean\nof the values returned by the verify() method, which subsequently will return the same output\nas openssl_verify() under most circumstances.\nThis means an error during signature verification is treated as a successful verification by the method.\n\nSince the signature validation of SAMLResponses were not affected, the impact of this security\nvulnerability is lower, but an update of the php-saml toolkit is recommended.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "onelogin/php-saml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.10.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/onelogin/php-saml/commit/949359f5cad5e1d085c4e5447d9aa8f49a6e82a1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/onelogin/php-saml/2017-02-28.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/SAML-Toolkits/php-saml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-17T23:06:54Z",
    "nvd_published_at" : null
  }
}