Attackers who obtain the NEXTAUTH_SECRET (or AUTH_SECRET) from Next.js applications using next-auth/Auth.js can mint arbitrary authentication cookies to impersonate any user and maintain persistent access. This is particularly concerning after React2Shell exploitation, where attackers can extract environment variables. The
•5m read time• From embracethered.com
Table of contents
Exploitation of React2ShellMandatory Secret RotationThe NEXTAUTH_SECRET is all you needCreating a Next Auth Cookie Minter (Code)Demonstration Video and WalkthroughPersistent Access to the ApplicationDetection OpportunitiesConclusionReferencesAppendixSort: