Bug 415467

Summary: Can't circumvent Google's browser blocking with user agent manager
Product: [Applications] Falkon Reporter: Bernhard Rosenkränzer <bero>
Component: generalAssignee: David Rosca <nowrep>
Status: RESOLVED FIXED    
Severity: normal CC: jurajoravec, kevin.kofler
Priority: NOR    
Version First Reported In: 3.1.0   
Target Milestone: ---   
Platform: OpenMandriva   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 22.08.02
Sentry Crash Report:

Description Bernhard Rosenkränzer 2019-12-23 02:31:08 UTC
SUMMARY
As you're probably aware, Google has started blocking Falkon users from accessing Google accounts.
https://ww.9to5google.com/2019/12/16/google-blocking-obscure-browsers-gmail/
When that article first appeared, I couldn't reproduce the problem; I can now, so apparently they're gradually rolling that "feature" out to all users.
To make things worse, using Falkon's User Agent Manager to fake the user agent strings doesn't work.

I tried with user agent strings set to:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/71.0
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36


all without success. Given how many people rely on Google services no matter how restrictive they get, it would be great if the user agent manager was extended to fake whatever Google is using in addition to the user agent string.


STEPS TO REPRODUCE
1. Go to gmail.com in Falkon
2. Try to sign in
3. If it works, wait for a while and try again, apparently they're not blocking all users at the same time
4. Set up fake user agents to try to circumvent the problem
5. Try again

OBSERVED RESULT
"This browser or app may not be secure. Learn more
Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in."

EXPECTED RESULT
Working gmail

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: OpenMandriva 4.1 beta
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.65.0
Qt Version: 5.14.0

ADDITIONAL INFORMATION
Comment 1 Juraj 2019-12-24 00:00:39 UTC
The best advice I can give you is to move away from Google.

Apart from changing user agent I do not know of any other way.

Sure, there might be a way to block it or reverse engeneer their detection system but in such company as Google they can change it anytime they want.

I also read about it, the best solution is to contact Google to remove it, or to contact some other influential organization to force them to disable it.
Comment 2 Kevin Kofler 2022-01-21 06:08:32 UTC
> Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/71.0

You have a mismatch there, 31.0 vs. 71.0. The string I get offered by Falkon 3.1.0 has both versions set to 57.0, and that works for me (and has worked for me ever since Google started doing this nonsense).
Comment 3 Kevin Kofler 2022-10-01 21:43:28 UTC
Update: Firefox 57.0 is no longer accepted now, so I changed it to 105.0 and that works:
Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0
(for the domain accounts.google.com).
(The Gecko/20100101 part is bogus, but they do not seem to check that.)
Comment 4 Juraj 2022-10-01 23:14:00 UTC
Thank you for reporting back.

In that case it seems like it is time to change the default Firefox and Safari UserAgents which are available in Falkon code (class UserAgentDialog) and update them to latest LTS versions.
Comment 5 Juraj 2022-10-02 17:07:01 UTC
Git commit 9082587737bf6b5a51f31588be925899ce33e18b by Juraj Oravec.
Committed on 02/10/2022 at 17:06.
Pushed by jurajo into branch 'release/22.08'.

Update Firefox version in user agent manager
FIXED-IN: 22.08.02

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>

M  +1    -1    src/lib/preferences/useragentdialog.cpp

https://invent.kde.org/network/falkon/commit/9082587737bf6b5a51f31588be925899ce33e18b
Comment 6 Juraj 2022-10-02 17:07:36 UTC
Git commit ef77ef730b935568ac70baceef9cb0ce9bbd61f9 by Juraj Oravec.
Committed on 02/10/2022 at 15:17.
Pushed by jurajo into branch 'master'.

Update Firefox version in user agent manager
FIXED-IN: 22.08.02

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>

M  +1    -1    src/lib/preferences/useragentdialog.cpp

https://invent.kde.org/network/falkon/commit/ef77ef730b935568ac70baceef9cb0ce9bbd61f9
Comment 7 Kevin Kofler 2022-10-02 23:03:22 UTC
Thank you for the quick fix. I can confirm that the user agent:
"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"
that will be in the new presets with 22.08.02 is currently accepted by accounts.google.com.
Comment 8 Kevin Kofler 2023-03-12 16:44:07 UTC
FYI, accounts.google.com now also uses the play.google.com domain for some reason, so you now have to set the same fake user agent also for play.google.com in addition to accounts.google.com.