Strapi @strapi/plugin-users-permissions authentication bypass in AWS Cognito

Severity: low · CVSS 3.1 · Published 2023-04-18

Strapi is a popular open-source headless CMS used to manage and deliver content to applications. Versions up to 4.5.6 fail to properly verify authentication tokens from AWS Cognito, allowing an attacker to forge tokens and impersonate any user. An attacker can bypass login entirely and gain unauthorized access to any user account, exposing sensitive application data and functionality without requiring valid credentials.

Technologies: @strapi/plugin-users-permissions (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Low severity, with a CVSS score of 3.1, published 18 April 2023.
Which products and versions are affected?
@strapi/plugin-users-permissions (npm) SEMVER:introduced=3.2.1,fixed=4.6.0.
Is there a fix for This vulnerability?
Yes. @strapi/plugin-users-permissions (npm): upgrade to 4.6.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run @strapi/plugin-users-permissions (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @strapi/plugin-users-permissions (npm): upgrade to 4.6.0 or later
    npm install @strapi/plugin-users-permissions@4.6.0

Technical details

The vulnerability is a JWT token validation bypass in the AWS Cognito OAuth provider for Strapi's users-permissions plugin. When processing the OAuth callback at /api/auth/cognito/callback, Strapi does not verify ID and access tokens, allowing an attacker to forge tokens signed with the 'None' algorithm to bypass authentication. The attack requires network access to the callback endpoint and no user interaction or authentication, but is restricted to users already configured with AWS Cognito as their login provider. An attacker can craft a valid JWT with claims for any existing user (identified by email and cognito:username) and gain full access to that account. The fix, included in Strapi 4.6.0 and later, adds proper token verification using JWKS public key validation.

Affected products

  • Strapi @strapi/plugin-users-permissions >=3.2.1, <4.6.0

Timeline

  • 2023-04-18: disclosed
  • 2023-04-18: patched: Fixed in Strapi v4.6.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.