CVE-2024-22206: @clerk/nextjs @clerk/nextjs Auth() And GetAuth() Methods Vulnerability
CRITICALCVE-2024-22206 is a CRITICAL (CVSS 9.0) @clerk/nextjs auth() and getauth() methods vulnerability (CWE-284: Improper Access Control) affecting @clerk/nextjs libraries in the npm ecosystem. The issue involves @clerk/nextjs auth() and getauth() methods vulnerable to insecure direct object reference (idor). Remediation is available by upgrading affected packages to version 4.29.3.
CVE-2024-22206 at a Glance
Security Impact
CVSS: 9.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2024-22206
To remediate this vulnerability, upgrade all affected @clerk/nextjs 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 @clerk/nextjs@4.29.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @clerk/nextjs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-22206, inspect your project dependencies using npm:
npm ls @clerk/nextjs
Analyze the terminal output to locate any version of @clerk/nextjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.29.3), your application is affected.
Note: The npm ls @clerk/nextjs 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In @clerk/nextjs, 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-2024-22206 Affected @clerk/nextjs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@clerk/nextjs
|
npm |
≥ 4.7.0
< 4.29.3
|
4.29.3
|
References
Frequently Asked Questions
What is CVE-2024-22206?
Which @clerk/nextjs versions are affected?
What version fixes CVE-2024-22206?
Is @clerk/nextjs affected?
What is the CVSS score of CVE-2024-22206?
What CWE is associated with CVE-2024-22206?
How can I check npm dependencies for CVE-2024-22206?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q6w5-jg5q-47vg",
"modified" : "2024-01-12T22:33:02Z",
"published" : "2024-01-12T20:27:29Z",
"aliases" : [ "CVE-2024-22206" ],
"summary" : "@clerk/nextjs auth() and getAuth() methods vulnerable to insecure direct object reference (IDOR) ",
"details" : "### Impact\nUnauthorized access or privilege escalation due to a logic flaw in `auth()` in the App Router or `getAuth()` in the Pages Router.\n\n### Affected Versions\nAll applications that that use `@clerk/nextjs` versions in the range of `>= 4.7.0`,`< 4.29.3` in a Next.js backend to authenticate API Routes, App Router, or Route handlers. Specifically, those that call `auth()` in the App Router or `getAuth()` in the Pages Router. Only the `@clerk/nextjs` SDK is impacted. Other SDKs, including other Javascript-based SDKs, are not impacted.\n\n### Patches\nFix included in `@clerk/nextjs@4.29.3`.\n\n### References\n- https://clerk.com/changelog/2024-01-12\n- https://github.com/clerk/javascript/releases/tag/%40clerk%2Fnextjs%404.29.3",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@clerk/nextjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.7.0"
}, {
"fixed" : "4.29.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/clerk/javascript/security/advisories/GHSA-q6w5-jg5q-47vg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22206"
}, {
"type" : "WEB",
"url" : "https://clerk.com/changelog/2024-01-12"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/clerk/javascript"
}, {
"type" : "WEB",
"url" : "https://github.com/clerk/javascript/releases/tag/%40clerk%2Fnextjs%404.29.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284", "CWE-287", "CWE-639" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-12T20:27:29Z",
"nvd_published_at" : "2024-01-12T20:15:47Z"
}
}