grandnode2 icon indicating copy to clipboard operation
grandnode2 copied to clipboard

Fix code scanning alert no. 234: URL redirection from remote source

Open KrzysztofPajak opened this issue 1 year ago • 0 comments

Fixes https://github.com/grandnode/grandnode2/security/code-scanning/234

To fix the problem, we should ensure that the returnUrl parameter is validated against a known list of safe URLs or ensure it is a relative URL. This can be done by maintaining a list of authorized redirects and checking the returnUrl against this list before performing the redirection. If the returnUrl is not in the list, it should default to a safe URL like the home page.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

KrzysztofPajak avatar Oct 04 '24 17:10 KrzysztofPajak