grandnode2
grandnode2 copied to clipboard
Fix code scanning alert no. 234: URL redirection from remote source
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.