Vulnerabilities in pkg:npm/@okta/oidc-middleware

PACKAGE
Advisory Identifier: GHSA-58h4-9m7m-j9m4
Advisory Summary

CVE-2022-3145 is a MODERATE (CVSS 4.7) @okta/oidc-middlewareopen redirect vulnerability vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting @okta/oidc middleware libraries in the npm ecosystem. The issue involves @okta/oidc-middlewareopen redirect vulnerability. Remediation is available by upgrading affected packages to version 5.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@okta/oidc-middleware

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@okta/oidc-middleware. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-58h4-9m7m-j9m4 CVE-2022-3145 MODERATE @okta/oidc-middlewareOpen Redirect vulnerability

CVE-2022-3145 at a Glance

CVE Identifier CVE-2022-3145
GHSA Identifier GHSA-58h4-9m7m-j9m4
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product @okta/oidc middleware
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.7

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:R/S:C/C:N/I:L/A:N).

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

How to Fix CVE-2022-3145

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

@okta/oidc-middleware fixed: 5.0.0
npm install @okta/oidc-middleware@5.0.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 @okta/oidc-middleware

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-3145, inspect your project dependencies using npm:

npm ls @okta/oidc-middleware

Analyze the terminal output to locate any version of @okta/oidc middleware in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.0), your application is affected.

Note: The npm ls @okta/oidc-middleware 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 CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In @okta/oidc middleware, 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

An open redirect vulnerability exists in Okta OIDC Middleware prior to version 5.0.0 allowing an attacker to redirect a user to an arbitrary URL. **Affected products and versions** Okta OIDC Middleware prior to version 5.0.0. **Resolution** The vulnerability is fixed in OIDC Middleware 5.0.0. To remediate this vulnerability, upgrade Okta OIDC Middleware to this version or later. **CVE details** **CVE ID:** [CVE-2022-3145](https://cve.mitre.org/cgi-bin/cvename.cgi?name=2022-3145) **Published Date:** 01/05/2023 **Vulnerability Type:** Open Redirect **CWE:** CWE-601 **CVSS v3.1 Score:** 4.3 **Severity:** Medium **Vector string:** AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N **Severity Details** To exploit this issue, an attacker would need to send a victim a malformed URL containing a target server that they control. Once a user successfully completed the login process, the victim user would then be redirected to the attacker controlled site. **References** https://github.com/okta/okta-oidc-middleware

CVE-2022-3145 Affected @okta/oidc middleware Versions

1 component(s)
Fixed Versions:
5.0.0
Product / Package Ecosystem Affected Versions Fixed Version
@okta/oidc-middleware
npm
< 5.0.0
5.0.0

References

Frequently Asked Questions

What is CVE-2022-3145?
CVE-2022-3145 is a security vulnerability in @okta/oidc middleware involving @okta/oidc-middlewareOpen Redirect vulnerability under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which @okta/oidc middleware versions are affected?
Affected versions include releases prior to 5.0.0 across affected packages: @okta/oidc-middleware.
What version fixes CVE-2022-3145?
Upgrading to 5.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @okta/oidc-middleware affected?
Yes, @okta/oidc-middleware is affected in releases prior to 5.0.0. Upgrade your dependency to 5.0.0 or later.
What is the CVSS score of CVE-2022-3145?
CVE-2022-3145 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2022-3145?
CVE-2022-3145 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for CVE-2022-3145?
Run the dependency tree command: 'npm ls @okta/oidc-middleware'. 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-58h4-9m7m-j9m4",
  "modified" : "2023-01-31T01:47:43Z",
  "published" : "2023-01-09T20:06:02Z",
  "aliases" : [ "CVE-2022-3145" ],
  "summary" : "@okta/oidc-middlewareOpen Redirect vulnerability",
  "details" : "An open redirect vulnerability exists in Okta OIDC Middleware prior to version 5.0.0 allowing an attacker to redirect a user to an arbitrary URL.\n\n**Affected products and versions**\nOkta OIDC Middleware prior to version 5.0.0.\n\n**Resolution**\nThe vulnerability is fixed in OIDC Middleware 5.0.0.  To remediate this vulnerability, upgrade Okta OIDC Middleware to this version or later.\n\n**CVE details**\n**CVE ID:**\t\t[CVE-2022-3145](https://cve.mitre.org/cgi-bin/cvename.cgi?name=2022-3145)\n**Published Date:**\t01/05/2023\n**Vulnerability Type:**\tOpen Redirect\n**CWE:**\t\t\tCWE-601\n**CVSS v3.1 Score:** 4.3\n**Severity:** Medium\n**Vector string:** AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N\n\n**Severity Details**\nTo exploit this issue, an attacker would need to send a victim a malformed URL containing a target server that they control. Once a user successfully completed the login process, the victim user would then be redirected to the attacker controlled site.\n\n**References**\nhttps://github.com/okta/okta-oidc-middleware",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@okta/oidc-middleware"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/okta/okta-oidc-middleware/security/advisories/GHSA-58h4-9m7m-j9m4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-3145"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/okta/okta-oidc-middleware/commit/5d10b3ccdd5d6893de4d8b58696094267d30c113"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/okta/okta-oidc-middleware"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-09T20:06:02Z",
    "nvd_published_at" : "2023-01-12T19:15:00Z"
  }
}