Closed Bug 1673847 Opened 6 years ago Closed 6 years ago

Bypass PKCE in Mozilla VPN on Windows

Categories

(Mozilla VPN :: Mozilla VPN Client, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

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

Flags: sec-bounty?
Group: firefox-core-security → mozilla-vpn-security
Component: Security → Client for Windows
Product: Firefox → Mozilla VPN

nils: thanks for the report, I'll escalate to the engineering team.

Status: UNCONFIRMED → NEW
Ever confirmed: true

We should have a release out sometime this week that addresses this issue. Thanks again for flagging it.

This issue was addressed in the 1.2.2 Windows release today.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Type: task → defect
Flags: sec-bounty? → sec-bounty+
Keywords: wsec-disclosure

Hi Frida, would it be possible to disclose this bug? Thanks

Flags: needinfo?(fkiriakos)

sure thing!

Group: mozilla-vpn-security
Flags: needinfo?(fkiriakos)
Component: Client for Windows → Mozilla VPN Client
You need to log in before you can comment on or make changes to this bug.