{"id":"CVE-2022-31093","published":"2022-06-27T21:30:20Z","modified":"2025-04-23T18:06:46Z","title":"Improper Handling of `callbackUrl` parameter in next-auth","vendor":"nextauthjs","product":"next-auth","tier":"tail","description":{"text":"NextAuth.js is a complete open source authentication solution for Next.js applications. In affected versions an attacker can send a request to an app using NextAuth.js with an invalid `callbackUrl` query parameter, which internally is converted to a `URL` object. The URL instantiation would fail due to a malformed URL being passed into the constructor, causing it to throw an unhandled error which led to the **API route handler timing out and logging in to fail**. This has been remedied in versions 3.29.5 and 4.5.0. If for some reason you cannot upgrade, the workaround requires you to rely on Advanced Initialization. Please see the documentation for more.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0181,"percentile":0.79055,"provenance":"source"},"cwes":[{"id":"CWE-754","name":"Improper Check for Unusual or Exceptional Conditions"}],"references":[{"url":"https://github.com/nextauthjs/next-auth/security/advisories/GHSA-g5fm-jp9v-2432","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/nextauthjs/next-auth/commit/25517b73153332d948114bacdff3b5908de91d85","tags":["x_refsource_MISC"]},{"url":"https://github.com/nextauthjs/next-auth/commit/e498483b23273d1bfc81be68339607f88d411bd6","tags":["x_refsource_MISC"]},{"url":"https://next-auth.js.org/configuration/initialization#advanced-initialization","tags":["x_refsource_MISC"]}],"priority":{"score":21.1,"factors":[{"name":"EPSS percentile","points":15.81},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"nextauthjs","affectedVersions":[{"vendor":"nextauthjs","product":"next-auth","versions":["< 3.29.5",">= 4.0.0, < 4.5.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-23T15:53:50.471341Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"next-auth","vulnerableRanges":["<3.29.5",">=4.0.0, <4.5.0"],"patched":["3.29.5","4.5.0"],"from":["GHSA-g5fm-jp9v-2432"],"provenance":"source"}],"summary":{"text":"The flaw is an improper handling of the callbackUrl query parameter in next-auth, the open source authentication library for Next.js applications. Sending a malformed callbackUrl causes an unhandled error during URL object construction, which can make the API route handler time out and login fail. An attacker with network access can trigger this by sending a request with an invalid callbackUrl parameter, requiring no authentication or user interaction and no particular configuration. The impact described is availability-related, namely disrupting the login process.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:13:43Z"},"euvd":{"id":"EUVD-2022-6046","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-21310","published":"2021-02-11","fixed":"3.3.0","kev":false},{"cve":"CVE-2022-24858","published":"2022-04-19","fixed":"4.3.2","kev":false},{"cve":"CVE-2022-29214","published":"2022-05-20","fixed":"4.3.3","kev":false,"link":{"from":"CVE-2022-29214","to":"CVE-2022-31093","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:next-auth","fromFixed":"3.29.3","toFixed":"3.29.5","daysApart":38},{"kind":"version-step","provenance":"source","package":"npm:next-auth","fromFixed":"4.3.3","toFixed":"4.5.0","daysApart":38}]}},{"cve":"CVE-2022-31093","published":"2022-06-27","fixed":"4.5.0","kev":false},{"cve":"CVE-2022-31127","published":"2022-07-06","fixed":"4.9.0","kev":false,"link":{"from":"CVE-2022-31093","to":"CVE-2022-31127","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:next-auth","fromFixed":"3.29.5","toFixed":"3.29.8","daysApart":9},{"kind":"version-step","provenance":"source","package":"npm:next-auth","fromFixed":"4.5.0","toFixed":"4.9.0","daysApart":9}]}},{"cve":"CVE-2022-31186","published":"2022-08-01","fixed":"4.10.2","kev":false},{"cve":"CVE-2022-35924","published":"2022-08-02","fixed":"4.10.3","kev":false}],"package":"npm:next-auth"}}