Bypass PKCE in Mozilla VPN on Windows
Categories
(Mozilla VPN :: Mozilla VPN Client, defect)
Tracking
(Not tracked)
People
(Reporter: nils, Unassigned)
Details
(Keywords: reporter-external, sec-moderate, wsec-disclosure, Whiteboard: [reporter-external] [client-bounty-form] [verif?])
This is a bug in the Mozilla VPN Windows client (https://github.com/mozilla-services/guardian-vpn-windows) version 1.2.
While reading the source code of the Windows client with the intention of implementing the new authentication flow for MozWire (https://github.com/NilsIrl/MozWire/), I found the issue.
The new authentication flow uses PKCE (RFC 7636, https://tools.ietf.org/html/rfc7636). PKCE uses a secret code verifier so that even if a malicious application can observe the response and access the authorization code (by registering its own protocol handler for example), the malicious application cannot retrieve an access token.
However, in the Windows client, the secret code verifier is stored in "CommonApplicationData" (C:\ProgramData) which is world readable. This means that a malicious application could register a protocol handler to retrieve the authorization code and then use the code verifier stored in C:\ProgramData\moz_gen_cvf.txt to get an access token.
Possible solutions:
- Store the code verifier in a safer place (e.g. in the user's home folder in C:\Users).
- Revert to the old flow
- Have the process which generated the code verifier be able to access the authorization code rather than the other way round (currently the process with the authorization code is the one accessing the code verifier), this can be done my using interprocess communication or by storing the authorization code on the filesystem (storing the authorization code on the filesystem wouldn't be an issue as the whole point of PKCE is to prevent a malicious app from getting an access token when it has an authorization code).
Line where the code verifier is written to a world readable location: https://github.com/mozilla-services/guardian-vpn-windows/blob/ac6f562973a83f6758cd7ab7aa313e863047d41b/ui/src/FxA/Login.cs#L64
Comment 1•6 years ago
|
||
nils: thanks for the report, I'll escalate to the engineering team.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 2•6 years ago
|
||
We should have a release out sometime this week that addresses this issue. Thanks again for flagging it.
Comment 3•6 years ago
|
||
This issue was addressed in the 1.2.2 Windows release today.
Comment 4•6 years ago
|
||
Relevant code fix can be found here: https://github.com/mozilla-services/guardian-vpn-windows/pull/145
Updated•5 years ago
|
Updated•4 years ago
|
Updated•2 years ago
|
Hi Frida, would it be possible to disclose this bug? Thanks
Updated•4 months ago
|
Description
•