Skip to content

Conversation

@nitishagar
Copy link

Add URL validation for the returnTo parameter in OIDC authentication flow to prevent open redirect vulnerabilities.

  • Add isValidReturnToUrl() helper function to validate URLs
  • Validate returnTo at input point (when storing in session)
  • Validate returnTo at output points (before redirects)
  • Reject external URLs with BadRequestError
  • Use safe fallback for invalid URLs at redirect points

Fixes #7

Add URL validation for the returnTo parameter in OIDC authentication
flow to prevent open redirect vulnerabilities.

- Add isValidReturnToUrl() helper function to validate URLs
- Validate returnTo at input point (when storing in session)
- Validate returnTo at output points (before redirects)
- Reject external URLs with BadRequestError
- Use safe fallback for invalid URLs at redirect points

Fixes jetkvm#7
@CLAassistant
Copy link

CLAassistant commented Nov 20, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open redirect via returnTo

2 participants