HTTP/1.0 Host:xxx.xxx.xx.x:3000 HTTP/1.1 308 P" /> HTTP/1.0 Host:xxx.xxx.xx.x:3000 HTTP/1.1 308 P" /> HTTP/1.0 Host:xxx.xxx.xx.x:3000 HTTP/1.1 308 P"/>

How to sanitize request url in Next Js to prevent XSS attacks

185 Views Asked by At

We ran security vulnerability scan on our next js app.It detected XSS with following result

GET /../\"> HTTP/1.0
Host:xxx.xxx.xx.x:3000

HTTP/1.1 308 Permanent Redirect
location: /../\">/
Refresh: 0;url=/../\">/
Date: TUE, 30 Jan 2024 02:36:50 GMT
Connection: close
/../\">/

To mitigate this vulnerability, it suggested to sanitize request url. As per my understanding the issue is with hiting url with script characters E.g. http://localhost:3000/../"> Is my understanding correct and how we can mitigate it?

0

There are 0 best solutions below