{"id":"CVE-2022-24858","aliases":["CVE-2022-24858","GHSA-f9wg-5f46-cjmw"],"related":[],"kind":"vulnerability","state":"published","title":"Default redirect callback vulnerable to open redirects","summary":"next-auth v3 users before version 3.29.2 are impacted. next-auth version 4 users before version 4.3.2 are also impacted. Upgrading to 3.29.2 or 4.3.2 will patch this vulnerability. If you are not able to upgrade for any reason, you can add a configuration to your callbacks option. If you already have a `redirect` callback, make sure that you match the incoming `url` origin against the `baseUrl`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"next-auth v3 users before version 3.29.2 are impacted. next-auth version 4 users before version 4.3.2 are also impacted. Upgrading to 3.29.2 or 4.3.2 will patch this vulnerability. If you are not able to upgrade for any reason, you can add a configuration to your callbacks option. If you already have a `redirect` callback, make sure that you match the incoming `url` origin against the `baseUrl`.","source":"cvelist"},{"lang":"en","text":"`next-auth` v3 users before version 3.29.2 are impacted. (We recommend upgrading to v4 in most cases. See our [migration guide](https://next-auth.js.org/getting-started/upgrade-v4)).`next-auth` v4 users before version 4.3.2 are impacted. Upgrading to 3.29.2 or 4.3.2 will patch this vulnerability. If you are not able to upgrade for any reason, you can add a configuration to your `callbacks` option:\n\n```js\n// async redirect(url, baseUrl) { // v3\nasync redirect({ url, baseUrl }) { // v4\n    // Allows relative callback URLs\n    if (url.startsWith(\"/\")) return new URL(url, baseUrl).toString()\n    // Allows callback URLs on the same origin\n    else if (new URL(url).origin === baseUrl) return url\n    return baseUrl\n}\n```\nIf you already have a `redirect` callback, make sure that you match the incoming `url` origin against the `baseUrl`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Los usuarios de next-auth versiones v3 anteriores a 3.29.2 están afectados. Los usuarios de next-auth versiones4 anteriores a la versión 4.3.2 también están afectados. La actualización a la versión 3.29.2 o 4.3.2 corregirá esta vulnerabilidad. Si no puede actualizar por alguna razón, puede añadir una configuración a su opción de callbacks. Si ya presenta una llamada de retorno \"redirect\", asegúrese de que el origen \"url\" entrante coincida con el \"baseUrl\"","source":"nvd"}],"published":"2022-04-19T22:25:10.000Z","modified":"2026-06-17T04:32:40.473Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:N","score":5.8,"rating":"MEDIUM"}],"cwes":["CWE-290","CWE-601"],"affected":[{"ranges":[{"version":"< 3.29.2, < 4.3.2","status":"affected"}],"vendor":"nextauthjs","product":"next-auth","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.29.2"}],"ecosystem":"npm","package":"next-auth","purl":"pkg:npm/next-auth","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.3.2"}],"ecosystem":"npm","package":"next-auth","purl":"pkg:npm/next-auth","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.0.0","fixed":"3.29.2"},{"status":"affected","introduced":"4.0.0","fixed":"4.3.2"}],"vendor":"nextauth.js","product":"next-auth","cpe":"cpe:2.3:a:nextauth.js:next-auth:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nextauthjs/next-auth/security/advisories/GHSA-f9wg-5f46-cjmw","tags":["mitigation","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://next-auth.js.org/configuration/callbacks#redirect-callback","tags":["vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://next-auth.js.org/getting-started/upgrade-v4","tags":["vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24858","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nextauthjs/next-auth/commit/6e15bdcb2d93c1ad5ee3889f702607637e79db50","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nextauthjs/next-auth","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.3.2","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-23T14:08:09.810Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-24858","url":"https://www.cve.org/CVERecord?id=CVE-2022-24858","licence":"CVE Terms of Use","modified":"2025-04-23T18:33:56.817Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f9wg-5f46-cjmw","url":"https://github.com/advisories/GHSA-f9wg-5f46-cjmw","licence":"CC-BY-4.0","modified":"2023-11-08T04:08:38.806Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-24858","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24858","licence":"Public domain","modified":"2026-06-17T04:32:40.473Z"}],"updatedAt":"2026-11-25T22:58:10.934Z","epss":{"score":0.0079,"percentile":0.57459,"date":"2026-12-01T12:00:22.000Z"}}