jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Protect: Link fails in email sent to unlock site

Open richardmtl opened this issue 8 years ago • 152 comments

Related to #8117

I had two reports of this this morning, in 831912-zen and 831859-zen.

In both cases, the users got the email to let them log in to their site. Upon clicking the login link, they got the following error:

{'error':'Bad Request','message':'Invalid input.'}

Note that 1 ticket was of a user that wasn't trusting REMOTE_ADDR, and the other was someone with many failed logins from their IP so they were blocked.

richardmtl avatar Dec 06 '17 14:12 richardmtl

cc @enejb

jeherve avatar Dec 06 '17 17:12 jeherve

The user see {'error':'Bad Request','message':'Invalid input.'} message after the login link expires of if they type the wrong link. Retrying again would work out for them.

cc: @lezama Should we increase the duration of that token?

enejb avatar Dec 06 '17 23:12 enejb

How long is the duration of the token, @enejb ? I don't know how long these folks waited; I would guess not a long time but I don't know for a fact.

richardmtl avatar Dec 07 '17 15:12 richardmtl

The link is only valid for 5 minutes.

It also says so in the email that we send out to the user.

Clicking the link below will allow you to either attempt additional login attempts or change your password for your WordPress site for 5 minutes from the ip address %2$s.

As I understand things users are usually only blocked for 20 minutes. So having something that is super long is probably not very useful.

But in the case where the token is not valid any more that doesn't seem to be the case.

enejb avatar Dec 07 '17 18:12 enejb

As I understand things users are usually only blocked for 20 minutes. So having something that is super long is probably not very useful.

Actually, no. Users can be blocked for much longer, ESPECIALLY in cases where we are trusting the wrong header (which is the majority of cases when users get blocked); in those cases, blocks can be effectively indefinite (the block expires and then are blocked again almost immediately, and for longer). At least, that's how I understand it, so.. I think 5 minutes is not long enough. Especially when a user is frazzled and locked out and not sure what's going on, they might not go check their email right away.

richardmtl avatar Dec 07 '17 19:12 richardmtl

I updated the email link duration to 15 minutes.

Can you explain a bit more about the wrong header? What is the issue there?

enejb avatar Dec 08 '17 05:12 enejb

Can you explain a bit more about the wrong header? What is the issue there?

This should explain things a bit: PCYsg-8f0-p2

You can also look at 1257-gh-jpop-issues for some recent examples of this issue.

jeherve avatar Dec 08 '17 14:12 jeherve

Thanks for the links. It would be good to implement some sort of solution where we automatically set the IP address in a better way. I know it really depends on the configuration of the server.

But maybe we can automate this somehow. For example if we know the IP address of the servers and make a request to the jetpack server. We could use the known predefined array of possible keys and headers and then try to configure the IP address that matched the one that we expect.

cc: @samhotchkiss What do you think?

enejb avatar Dec 08 '17 19:12 enejb

Same problem here, unlock site link not working. I'm clicking within 5 minutes but still. I have to login to wordpress.com, go to settings, security, and disable protection, before logging in and activating protection again. Adding my IP adress to the whitelist does not solve the issue.

merire111 avatar Dec 14 '17 18:12 merire111

@merire111 Your site likely needs us to tweak a setting on our end. Can you contact us directly please?

https://jetpack.com/contact-support/

richardmtl avatar Dec 14 '17 18:12 richardmtl

Same problem here too, unlock site link doesn't work. Not sure why this would be opt out and not opt in.

Jzatopa avatar Jan 15 '18 04:01 Jzatopa

Same issue on 900393-zen In here, the user wasn't trusting REMOTE_ADDR so I switched to it.

StefMattana avatar Jan 15 '18 08:01 StefMattana

Also reported in 899797-zen The user wasn't trusting REMOTE_ADDR so I switched to it.

StefMattana avatar Jan 15 '18 14:01 StefMattana

@enejb It is my understanding that if the Headers that we are looking at are incorrect on our end, then the link won't work. I don't know what percentage of people who get blocked are blocked because they mistakenly enter the wrong password (and thus the link is useful for them), versus the people blocked because the headers we are trusting are wrong (and thus the link won't work for them). However, right now we are giving all the people with incorrect trusted headers "false hope" that they can get into their site by clicking the link we send them. I suppose there's no easy way to filter those out so we don't even send them a link and we just say "contact us please"?

richardmtl avatar Jan 15 '18 18:01 richardmtl

I think there might be a way to filter them out. Will look into this some more. Great suggestion!

enejb avatar Jan 15 '18 18:01 enejb

Also I think this should be fixed via the Jetpack UI somehow. Telling the user something is wrong and what they should do to fix it. (Contact support)

enejb avatar Jan 15 '18 19:01 enejb

Also I think this should be fixed via the Jetpack UI somehow. Telling the user something is wrong and what they should do to fix it. (Contact support) cc: @samhotchkiss and @MichaelArestad :)

enejb avatar Jan 15 '18 21:01 enejb

More discussion at p7rcWF-HJ-p2

jeherve avatar Jan 16 '18 10:01 jeherve

I got this request when trying to login. Had it sent to email. Got this: {"error":"Bad Request","message":"Invalid input."}

And I did it all in minutes. So no timeout on the request. I'd say your plugin is broken.

vrocks avatar Jan 30 '18 11:01 vrocks

@vrocks Could you contact us via this contact form and give us more details about your site? We'll help you get this fixed on your site.

Thanks!

jeherve avatar Jan 31 '18 07:01 jeherve