CVE-2022-3145: @okta/oidc middleware @okta/oidc-middlewareOpen Redirect Vulnerability Vulnerability
MODERATECVE-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.
CVE-2022-3145 at a Glance
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).
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.
npm install @okta/oidc-middleware@5.0.0
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
CVE-2022-3145 Affected @okta/oidc middleware Versions
1 component(s)| 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?
Which @okta/oidc middleware versions are affected?
What version fixes CVE-2022-3145?
Is @okta/oidc-middleware affected?
What is the CVSS score of CVE-2022-3145?
What CWE is associated with CVE-2022-3145?
How can I check npm dependencies for CVE-2022-3145?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}