GHSA-7wh8-jrq7-p27f: Simplesamlphp/simplesamlphp SimpleSAMLphp Exposes Credentials Vulnerability

MODERATE
CVSS 5.3
CWE-522
Published
Advisory Summary

GHSA-7wh8-jrq7-p27f is a MODERATE (CVSS 5.3) simplesamlphp exposes credentials vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Simplesamlphp/simplesamlphp libraries in the Packagist ecosystem. The issue involves simplesamlphp exposes credentials in session storage. Remediation is available by upgrading affected packages to version 1.16.3.

GHSA-7wh8-jrq7-p27f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7wh8-jrq7-p27f
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Simplesamlphp/simplesamlphp
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-7wh8-jrq7-p27f

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

simplesamlphp/simplesamlphp fixed: 1.16.3
Upgrade simplesamlphp/simplesamlphp to 1.16.3
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 simplesamlphp/simplesamlphp

How to Check if You Are Affected

To determine whether your application is affected by GHSA-7wh8-jrq7-p27f, inspect your project dependencies for Simplesamlphp/simplesamlphp:

inspect dependencies for simplesamlphp/simplesamlphp

Analyze the terminal output to locate any version of Simplesamlphp/simplesamlphp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.3), 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 CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Simplesamlphp/simplesamlphp, 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

### Background In order to implement support for the SAML Enhanced Client or Proxy profile, the credentials obtained for authentication were stored in the state in order to pass them to the relevant routines. This, however, led to the credentials being recorded in the user’s session, which can be stored in permanent storage such as the local file system or a remote memcache or database server. ### Description When an authentication request is received via the ECP profile, the username and password obtained this way were saved to the state array, which is used to pass relevant data to different routines that may need it. This is not a problem in itself. However, when the ECP profile is disabled in the Identity Provider, other bindings such as HTTP-POST or HTTP-Redirect will be used, and since redirections are involved, the state array is then persisted to the user’s session, effectively storing it in the session backend. The ECP profile, which uses the SOAP and PAOS bindings, does not involve any HTTP redirection for the user, and for that reason the state array containing the credentials is never persisted to the session. The logic for determining when to save the credentials to the state array assumed wrongly, though, that if the authentication request came in on the SOAP binding, that means the ECP profile is used. This may not be true as ECP can be disabled by configuration in the IdP’s hosted SAML metadata, and in that case SimpleSAMLphp would then try to default to a binding different than PAOS, such as HTTP-POST or HTTP-Redirect, effectively consolidating the entire state array to the user’s session as described before. In practice, any Identity Provider with the ECP profile disabled but metadata for an entity that supports ECP, would reject incoming ECP requests, but write the credentials obtained in the request to the user’s session, which will be stored in the session store, whichever is used (local file system in case PHP sessions are used, Memcache, Redis, relational databases, etc). ### Affected versions All SimpleSAMLphp versions 1.16.x are affected, up to 1.16.2. ### Impact An Identity Provider with metadata for trusted entities that support the SAML ECP profile, may end up storing the user’s credentials received from such entities in its own session storage, whatever that is, in case ECP is actually not enabled in the IdP. Under such circumstances, the credentials may be then accessible to administrators, other personnel or even malicious parties who may have access to the systems where sessions or their backups are stored.

GHSA-7wh8-jrq7-p27f Affected Simplesamlphp/simplesamlphp Versions

1 component(s)
Fixed Versions:
1.16.3
Product / Package Ecosystem Affected Versions Fixed Version
simplesamlphp/simplesamlphp
Packagist
≥ 1.16.0
< 1.16.3
1.16.3

References

Frequently Asked Questions

What is GHSA-7wh8-jrq7-p27f?
GHSA-7wh8-jrq7-p27f is a security vulnerability in Simplesamlphp/simplesamlphp involving SimpleSAMLphp exposes credentials in session storage under CWE-522: Insufficiently Protected Credentials.
Which Simplesamlphp/simplesamlphp versions are affected?
Affected versions include releases prior to 1.16.3 across affected packages: simplesamlphp/simplesamlphp.
What version fixes GHSA-7wh8-jrq7-p27f?
Upgrading to 1.16.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is simplesamlphp/simplesamlphp affected?
Yes, simplesamlphp/simplesamlphp is affected in releases prior to 1.16.3. Upgrade your dependency to 1.16.3 or later.
What is the CVSS score of GHSA-7wh8-jrq7-p27f?
GHSA-7wh8-jrq7-p27f has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-7wh8-jrq7-p27f?
GHSA-7wh8-jrq7-p27f is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check Packagist dependencies for GHSA-7wh8-jrq7-p27f?
Run the dependency tree command: 'inspect dependencies for simplesamlphp/simplesamlphp'. 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-7wh8-jrq7-p27f",
  "modified" : "2024-05-28T18:28:53Z",
  "published" : "2024-05-28T18:28:53Z",
  "aliases" : [ ],
  "summary" : "SimpleSAMLphp exposes credentials in session storage",
  "details" : "### Background\nIn order to implement support for the SAML Enhanced Client or Proxy profile, the credentials obtained for authentication were stored in the state in order to pass them to the relevant routines. This, however, led to the credentials being recorded in the user’s session, which can be stored in permanent storage such as the local file system or a remote memcache or database server.\n\n### Description\nWhen an authentication request is received via the ECP profile, the username and password obtained this way were saved to the state array, which is used to pass relevant data to different routines that may need it. This is not a problem in itself. However, when the ECP profile is disabled in the Identity Provider, other bindings such as HTTP-POST or HTTP-Redirect will be used, and since redirections are involved, the state array is then persisted to the user’s session, effectively storing it in the session backend.\n\nThe ECP profile, which uses the SOAP and PAOS bindings, does not involve any HTTP redirection for the user, and for that reason the state array containing the credentials is never persisted to the session. The logic for determining when to save the credentials to the state array assumed wrongly, though, that if the authentication request came in on the SOAP binding, that means the ECP profile is used. This may not be true as ECP can be disabled by configuration in the IdP’s hosted SAML metadata, and in that case SimpleSAMLphp would then try to default to a binding different than PAOS, such as HTTP-POST or HTTP-Redirect, effectively consolidating the entire state array to the user’s session as described before.\n\nIn practice, any Identity Provider with the ECP profile disabled but metadata for an entity that supports ECP, would reject incoming ECP requests, but write the credentials obtained in the request to the user’s session, which will be stored in the session store, whichever is used (local file system in case PHP sessions are used, Memcache, Redis, relational databases, etc).\n\n### Affected versions\nAll SimpleSAMLphp versions 1.16.x are affected, up to 1.16.2.\n\n### Impact\nAn Identity Provider with metadata for trusted entities that support the SAML ECP profile, may end up storing the user’s credentials received from such entities in its own session storage, whatever that is, in case ECP is actually not enabled in the IdP. Under such circumstances, the credentials may be then accessible to administrators, other personnel or even malicious parties who may have access to the systems where sessions or their backups are stored.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "simplesamlphp/simplesamlphp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.16.0"
      }, {
        "fixed" : "1.16.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/simplesamlphp/simplesamlphp/commit/44d1e3052930d93f0f554c25bc7c7602f8136880"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/simplesamlphp/simplesamlphp/2018-12-20.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/simplesamlphp/simplesamlphp"
  }, {
    "type" : "WEB",
    "url" : "https://simplesamlphp.org/security/201812-01"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-522" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-28T18:28:53Z",
    "nvd_published_at" : null
  }
}