{"id":"CVE-2022-24858","aliases":["EUVD-2022-1719","GHSA-f9wg-5f46-cjmw"],"status":"published","title":"Default redirect callback vulnerable to open redirects","description":"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`.","severity":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.0079,"percentile":0.56718,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-290","CWE-601"],"published":"2022-04-19T22:25:10Z","modified":"2026-10-28T02:31:07Z","fixes":[{"ecosystem":"npm","package":"next-auth","fixed_in":["3.29.2","4.3.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"next-auth","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.29.2"}]}]},{"source":"ghsa","ecosystem":"npm","package":"next-auth","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.3.2"}]}]},{"source":"osv","ecosystem":"npm","package":"next-auth","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.29.2"}]}]},{"source":"osv","ecosystem":"npm","package":"next-auth","ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"4.3.2"}]}]}],"products":[{"vendor":"nextauth.js","product":"next-auth"},{"vendor":"nextauthjs","product":"next-auth"}],"references":[{"url":"https://github.com/nextauthjs/next-auth/security/advisories/GHSA-f9wg-5f46-cjmw","tags":["x_refsource_CONFIRM","x_transferred","Mitigation","Third Party Advisory","advisory","web"]},{"url":"https://next-auth.js.org/configuration/callbacks#redirect-callback","tags":["x_refsource_MISC","x_transferred","Vendor Advisory","web"]},{"url":"https://next-auth.js.org/getting-started/upgrade-v4","tags":["x_refsource_MISC","x_transferred","Vendor Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24858","tags":["advisory"]},{"url":"https://github.com/nextauthjs/next-auth/commit/6e15bdcb2d93c1ad5ee3889f702607637e79db50","tags":["web"]},{"url":"https://github.com/nextauthjs/next-auth/releases/tag/next-auth%40v4.3.2","tags":["web"]},{"url":"https://github.com/advisories/GHSA-f9wg-5f46-cjmw"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24858.json","tags":["advisory"]},{"url":"https://github.com/nextauthjs/next-auth","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-24858","title":"Default redirect callback vulnerable to open redirects","description":"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`.","status":"published","published":"2022-04-19T22:25:10Z","modified":"2025-04-23T18:33:56.817Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-290"],"updated_at":"2026-11-02T14:34:34.576287Z"}],"euvd":[{"id":"EUVD-2022-1719","description":"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`.","status":"published","published":"2022-04-19T22:25:10Z","modified":"2025-04-23T18:33:56Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-02T20:52:08.401317Z"}],"ghsa":[{"id":"GHSA-f9wg-5f46-cjmw","title":"NextAuth.js default redirect callback vulnerable to open redirects","description":"`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`.","status":"published","published":"2022-04-22T20:49:09Z","modified":"2023-01-27T05:01:58Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-290","CWE-601"],"updated_at":"2026-11-02T14:36:17.04874Z"}],"nvd":[{"id":"CVE-2022-24858","description":"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`.","status":"published","published":"2022-04-19T23:15:13.317Z","modified":"2026-06-17T04:32:40.473Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":5.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-290","CWE-601"],"updated_at":"2026-11-02T14:07:16.9948Z"}],"osv":[{"id":"CVE-2022-24858","title":"Default redirect callback vulnerable to open redirects","description":"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`.","status":"published","published":"2022-04-19T22:25:10Z","modified":"2026-10-28T02:31:07.044558941Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-290"],"updated_at":"2026-11-02T15:44:24.428403Z"},{"id":"GHSA-f9wg-5f46-cjmw","title":"NextAuth.js default redirect callback vulnerable to open redirects","description":"`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`.","status":"published","published":"2022-04-22T20:49:09Z","modified":"2023-11-08T04:08:38.806013Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-290","CWE-601"],"updated_at":"2026-11-02T15:46:46.39441Z"}]}}
