I’m looking to better understand the CSRF risks associated with SolidStart, specifically regarding the use of RPC calls with the "use server" function.
In Next.js, when I process a form with server actions, the risk of CSRF attacks is significantly reduced for a few reasons:
- Server actions are limited to
POSTrequests. - Modern browsers enforce
Same-Sitecookies by default, which helps mitigate CSRF vulnerabilities. - I can further enhance security by ensuring that all cookies have the
SameSite=Strict,HttpOnly, andSecuresettings.
With SolidStart, using "use server" means I’m making an RPC call to that function. It's my understanding that RPC calls use HTTP POST to invoke specific server-side functions by name.
Given this, I believe the same three points regarding CSRF risk reduction should apply to SolidStart as well.
Am I correct in my understanding? If not, what potential CSRF risks should I be aware of when using RPC calls in SolidStart?
Thank you!
Chris