GHSA-xv3q-jrmm-4fxv: @strapi/plugin users permissions Authentication Bypass Vulnerability

HIGH
CVSS 8.2
Published
Advisory Summary

GHSA-xv3q-jrmm-4fxv is a HIGH (CVSS 8.2) authentication bypass vulnerability (General Security Weakness) affecting @strapi/plugin users permissions libraries in the npm ecosystem. The issue involves authentication bypass in @strapi/plugin-users-permissions. Remediation is available by upgrading affected packages to version 4.6.0.

GHSA-xv3q-jrmm-4fxv at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xv3q-jrmm-4fxv
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification General Security Weakness
Affected Product @strapi/plugin users permissions
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.2

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:H/I:L/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 High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-xv3q-jrmm-4fxv

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

@strapi/plugin-users-permissions fixed: 4.6.0
npm install @strapi/plugin-users-permissions@4.6.0
Verify Direct and Transitive Dependencies

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

npm ls @strapi/plugin-users-permissions

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-xv3q-jrmm-4fxv, inspect your project dependencies using npm:

npm ls @strapi/plugin-users-permissions

Analyze the terminal output to locate any version of @strapi/plugin users permissions in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.0), your application is affected.

Note: The npm ls @strapi/plugin-users-permissions command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In @strapi/plugin users permissions, 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

### Summary Strapi through 4.5.6 does not verify the access or ID tokens issued during the OAuth flow when the AWS Cognito login provider is used for authentication. ### Details Strapi through 4.5.6 does not verify the access or ID tokens issued during the OAuth flow when the AWS Cognito login provider is used for authentication. A remote attacker could forge an ID token that is signed using the 'None' type algorithm to bypass authentication and impersonate any user that use AWS Cognito for authentication. ### IoC Reviewing of application logs is recommended to detect any suspicious activity. Running the following regex pattern will extract all ID tokens sent to `/api/auth/cognito/callback`. `/\/api\/auth\/cognito\/callback\?[\s\S]*id_token=\s*([\S]*)/` Once you have a list of the ID tokens, you will need to verify each token using the public key file for your AWS Cognito user pool that you can download from `https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json`. If there are any JWT tokens that cannot be verified using the correct public key, then you need to inspect the JWT body and see if it contains the `email` and `cognito:username` claims (example below). ```json { "cognito:username": "auth-bypass-example", "email": "user@example.com" } ``` If there are any JWTs that have this body, verify when the account with the email address was created. If the account was created earlier than the request to `/api/auth/cognito/callback` with the invalid JWT token, then you need to contact the user to inform them their account has been breached! After upgrading to Strapi v4.6.0 or greater you will need to reconfigure your AWS Cognito provider to include the JWKS URL for it to work properly. If you do not reconfigure your provider you will receive an error message when attempting to login. ### Impact Any Strapi user using the users-permissions AWS Cognito provider before 4.6.0

GHSA-xv3q-jrmm-4fxv Affected @strapi/plugin users permissions Versions

1 component(s)
Fixed Versions:
4.6.0
Product / Package Ecosystem Affected Versions Fixed Version
@strapi/plugin-users-permissions
npm
≥ 3.2.1
< 4.6.0
4.6.0

References

Frequently Asked Questions

What is GHSA-xv3q-jrmm-4fxv?
GHSA-xv3q-jrmm-4fxv is a security vulnerability in @strapi/plugin users permissions involving Authentication Bypass in @strapi/plugin-users-permissions under General Security Weakness.
Which @strapi/plugin users permissions versions are affected?
Affected versions include releases prior to 4.6.0 across affected packages: @strapi/plugin-users-permissions.
What version fixes GHSA-xv3q-jrmm-4fxv?
Upgrading to 4.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @strapi/plugin-users-permissions affected?
Yes, @strapi/plugin-users-permissions is affected in releases prior to 4.6.0. Upgrade your dependency to 4.6.0 or later.
What is the CVSS score of GHSA-xv3q-jrmm-4fxv?
GHSA-xv3q-jrmm-4fxv has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with GHSA-xv3q-jrmm-4fxv?
GHSA-xv3q-jrmm-4fxv is classified under General Security Weakness.
How can I check npm dependencies for GHSA-xv3q-jrmm-4fxv?
Run the dependency tree command: 'npm ls @strapi/plugin-users-permissions'. 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-xv3q-jrmm-4fxv",
  "modified" : "2023-04-18T22:28:02Z",
  "published" : "2023-04-18T22:28:02Z",
  "aliases" : [ ],
  "summary" : "Authentication Bypass in @strapi/plugin-users-permissions",
  "details" : "### Summary\n\nStrapi through 4.5.6 does not verify the access or ID tokens issued during the OAuth flow when the AWS Cognito login provider is used for authentication.\n\n### Details\n\nStrapi through 4.5.6 does not verify the access or ID tokens issued during the OAuth flow when the AWS Cognito login provider is used for authentication. A remote attacker could forge an ID token that is signed using the 'None' type algorithm to bypass authentication and impersonate any user that use AWS Cognito for authentication.\n\n### IoC\n\nReviewing of application logs is recommended to detect any suspicious activity. Running the following regex pattern will extract all ID tokens sent to `/api/auth/cognito/callback`.\n\n`/\\/api\\/auth\\/cognito\\/callback\\?[\\s\\S]*id_token=\\s*([\\S]*)/`\n\nOnce you have a list of the ID tokens, you will need to verify each token using the public key file for your AWS Cognito user pool that you can download from `https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json`. If there are any JWT tokens that cannot be verified using the correct public key, then you need to inspect the JWT body and see if it contains the `email` and `cognito:username` claims (example below).\n\n```json\n{\n  \"cognito:username\": \"auth-bypass-example\",\n  \"email\": \"user@example.com\"\n}\n```\n\nIf there are any JWTs that have this body, verify when the account with the email address was created. If the account was created earlier than the request to `/api/auth/cognito/callback` with the invalid JWT token, then you need to contact the user to inform them their account has been breached!\n\nAfter upgrading to Strapi v4.6.0 or greater you will need to reconfigure your AWS Cognito provider to include the JWKS URL for it to work properly. If you do not reconfigure your provider you will receive an error message when attempting to login.\n\n\n### Impact\n\nAny Strapi user using the users-permissions AWS Cognito provider before 4.6.0\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/plugin-users-permissions"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.1"
      }, {
        "fixed" : "4.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/security/advisories/GHSA-xv3q-jrmm-4fxv"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/pull/15382"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/commit/d0edd25ceb49d275d710bf8d59999a2c07072893"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/strapi/strapi"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/releases/tag/v4.6.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-18T22:28:02Z",
    "nvd_published_at" : null
  }
}