Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/feature remove validate referer before oidc #1126

Open
itaybar opened this issue May 9, 2024 · 0 comments
Open

bug/feature remove validate referer before oidc #1126

itaybar opened this issue May 9, 2024 · 0 comments

Comments

@itaybar
Copy link
Contributor

itaybar commented May 9, 2024

			const validOrigins = [
				new URL(event.request.url).host,
				...(envPublic.PUBLIC_ORIGIN ? [new URL(envPublic.PUBLIC_ORIGIN).host] : []),
			];

			if (!validOrigins.includes(new URL(origin).host)) {
				return errorResponse(403, "Invalid referer for POST request");
			}

const validOrigins = [

In this code found in src/hooks.server.ts there is validation rather the referer is from the PUBLIC_ORIGIN, this is bad for 2 reasons,

  1. the OIDC provider it self will validate the referer
  2. If the is an NGINX (or other similar product), it will failed that for no reason (and you can't just configure the PUBLIC_ORIGIN to be your Nginx one because in this way you are have to use the NGINX and can't access straight which is weird
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

No branches or pull requests

1 participant