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

Leaky Database #1

Open
Andersama opened this issue Nov 19, 2024 · 1 comment
Open

Leaky Database #1

Andersama opened this issue Nov 19, 2024 · 1 comment

Comments

@Andersama
Copy link

Andersama commented Nov 19, 2024

If someone were to probe the /forgot-password route they can get feedback which emails exist in the database without a throttle limiting the request.

Like the /signup route there's a check against the ip address making the request. However ideally following /forgot-password through always results in landing on /forgot-password/verify-email as opposed to being redirected elsewhere because the "session" should be poisoned to never accept a code.

@Andersama
Copy link
Author

	const clientIP = request.headers.get("X-Forwarded-For");
	if (clientIP !== null && !ipBucket.check(clientIP, 1)) {
        console.log(clientIP);
        count = 1;
	} else {
	// We also don't have to assume "X-Forwarded-For" is filled out.
		const cliAddr = event.getClientAddress();
        console.log(cliAddr);
		if (cliAddr !== null && !ipBucket.check(cliAddr, 1)) {
            count = 1;
		}
	}

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