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

Use Google Safe Browsing API for recipient domains check #5357

Open
frerghost opened this issue Aug 12, 2023 · 16 comments
Open

Use Google Safe Browsing API for recipient domains check #5357

frerghost opened this issue Aug 12, 2023 · 16 comments
Assignees

Comments

@frerghost
Copy link

frerghost commented Aug 12, 2023

Google Workspace (went through troubleshooting to determine it was FlowCrypt extension), Chrome is up to date:
Version 115.0.5790.171 (Official Build) (64-bit),

When I send an email to a specific address: xcxxxxxx EMAIL ADDRESS NOT ALLOWED TO PUT HERE THAT CAUSES THE PROBLEM it removes me from Chrome and slams me into a Dangerous Notice page. Specifically, I can do NOTHING once I click anything like Subject Line, Body, etc. without being removed from Google Workspace Gmail and sent to the below screen. No similar issue with Gmail, Outlook, Proton etc. Happens on Windows or Ubuntu.

Love the product, but this is an issue. As background, the person has no website, never has, and his email is ported through paid Yahoo Turbify.

Never seen this action happen in the 12+ years I have used Google. The scary thing here is that it allows the hijacking of Google Workspace to send to that page and that is something to look at! That is a level of command and control that needs to be addressed and new permission notices issued.

Thank you!

Updates to some portions that were "emotional" language. ;) I also advised the party to contact their IT folks as well as removed the above video as it has email info in it. Thanks again for all your hard work!

@github-actions
Copy link

There were 1 email addresses found in the above comment. Please:

  1. Click three dots -> edit to remove the email addresses.
  2. Click edited in the comment header, and click on the previous revision of the comment.
  3. When viewing the old revision with an email in it, click options -> delete this revision from history.

@frerghost frerghost changed the title Complete Lockout From Google Workspace Complete Removal From Google Workspace Aug 12, 2023
@github-actions
Copy link

There were 1 email addresses found in the above comment. Please:

  1. Click three dots -> edit to remove the email addresses.
  2. Click edited in the comment header, and click on the previous revision of the comment.
  3. When viewing the old revision with an email in it, click options -> delete this revision from history.

@martgil
Copy link
Collaborator

martgil commented Aug 14, 2023

Hello,

Thanks for reporting this to us.

I've visited https://fivestarpropertymgmt.com and this alone is sufficient to trigger Google's deceptive site warning.

image

Clicking 'Details' button and proceeding to visit https://fivestarpropertymgmt.com shows just the following site:

image

In the case where it is triggered when the FlowCrypt browser extension is installed and composing a regular email going to for example test @ fivestarpropertymgmt.com (without spaces), the FlowCrypt browser extension tries to lookup for a public key via an AJAX requests to openpgpkey.fivestarpropertymgmt.com that is being prevented by Google browser. Just a side note that at this point, no request has been made yet, until users would like to proceed further by clicking 'Details' -> 'visit this unsafe site.' but keep in mind that it wont actually redirect user directly to it but by just letting the AJAX request to be made.

Example: (clicking run will show the Google warning replicating the scenario shown in the video above) https://jsfiddle.net/w650egqt/

Let's hear some feedback from our team members. @tomholub @sosnovsky An AJAX request at openpgpkey.domain.com seemed to be called when the FlowCrypt browser extension is installed while a user is composing a regular Gmail email.

@martgil
Copy link
Collaborator

martgil commented Aug 14, 2023

@sosnovsky
Copy link
Collaborator

Hi @frerghost,

thanks for letting us know about such issue!

It happens because FlowCrypt browser extension checks if recipients of your message have encryption enabled.
Check is done by sending request to openpgpkey.RECIPIENT_DOMAIN, and if recipient public key is available - compose box will show Your recipients seem to have encryption set up notification with link to secure compose:

Screenshot 2023-08-14 at 14 18 50

And as domain of your recipient is marked as unsafe by Chrome, it shows full-page warning like when you open this website.

To fix this issue we'll need to add check for safety of recipient domains and try to fetch public keys only from safe domains.
I'll plan this functionality in our current milestone, thanks again for reporting!

@sosnovsky sosnovsky added this to the 8.5.1 milestone Aug 14, 2023
@sosnovsky
Copy link
Collaborator

Seems like we can use Google Safe Browsing Lookup API - https://developers.google.com/safe-browsing/v4/lookup-api

@sosnovsky sosnovsky changed the title Complete Removal From Google Workspace Use Google Safe Browsing API for recipient domains check Aug 14, 2023
@frerghost
Copy link
Author

Appreciate it and have a great day! Love the product and soooo appreciative of your work!

@sosnovsky sosnovsky modified the milestones: 8.5.1, 8.5.2 Sep 30, 2023
@ioanmo226
Copy link
Collaborator

ioanmo226 commented Oct 3, 2023

Hey, @sosnovsky, which API key should we use?
Generating an API key and sticking it in the frontend doesn't seem smart to me.
If we put it in our backend and create our own API, we need to submit domain to our api and retrieve threatMatches result.
I think making our backend api makes sense as we only need to submit domain (no sensitive info) to api and retrieve threatMatches result.

What's your take on this?

The request header includes the request URL and the content type. Remember to substitute your API key for API_KEY in the URL.
POST https://safebrowsing.googleapis.com/v4/threatMatches:find?key=API_KEY HTTP/1.1
Content-Type: application/json

@sosnovsky
Copy link
Collaborator

Google allows to restrict API key usage to specific websites, maybe it's possible to create key which will be limited to usage only in FlowCrypt extension? Then we can include it in extension code

@ioanmo226
Copy link
Collaborator

Didn't know it. That sounds good though!

@ioanmo226
Copy link
Collaborator

@sosnovsky Finished checking and it seems possible to only restrict to specific browser extension.
Could you generate api key (set limit to only browser extension) and provide it?
Or @tomholub should have a look at it?

@sosnovsky
Copy link
Collaborator

I think we have configured FlowCrypt project at Google Developer console, and API key should be generated there, but unfortunately I don't have access it.

Can you please generate some temporary API key for development for now? And before merging we'll replace it with the correct FlowCrypt API key.

@tomholub what will be the better way for generating FlowCrypt API key from Google Developer console to use with Google Safe Browsing API? You can do it or maybe you can give me access to FlowCrypt project there, I'll generate a key and share it with Ioan?

@ioanmo226
Copy link
Collaborator

Sounds good

@frerghost
Copy link
Author

Thank you folks for working so hard and keeping encryption safe!

@tomholub
Copy link
Collaborator

tomholub commented Oct 20, 2023

Roma, Could you please share some reference that shows it's okay to keep the api key exposed in the client?

Also cc @martgil

@sosnovsky
Copy link
Collaborator

I tested limiting API key only to specific extension, but looks like it's not possible - we can only limit it to some URL (https://mail.google.com in our case). So someone can copy API key and use it in another extension on mail.google.com (however this API key will be limited only to Safe Browsing API).

I'll try to find some other way for detecting dangerous websites before performing openpgpkey.RECIPIENT_DOMAIN request.

@sosnovsky sosnovsky self-assigned this Oct 23, 2023
@sosnovsky sosnovsky modified the milestones: 8.5.3, 8.5.4 Dec 14, 2023
@sosnovsky sosnovsky modified the milestones: 8.5.4, 8.5.5 Mar 1, 2024
@sosnovsky sosnovsky modified the milestones: 8.5.5, 8.5.6 May 13, 2024
@sosnovsky sosnovsky modified the milestones: 8.5.6, 8.5.7, First priority May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants