-
Notifications
You must be signed in to change notification settings - Fork 896
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
Redone SafeBrowsing by using SafeBrowsingApiHandler and SafetyNetClient #25842
Conversation
ff8c1af
to
9b6df6f
Compare
9b6df6f
to
a7d2b27
Compare
The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "safebrowsing" and so security team members have been added as reviewers to take a look. |
...sing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingApiHandler.java
Outdated
Show resolved
Hide resolved
...sing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingApiHandler.java
Outdated
Show resolved
Hide resolved
..._browsing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingUtils.java
Outdated
Show resolved
Hide resolved
..._browsing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingUtils.java
Outdated
Show resolved
Hide resolved
..._browsing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingUtils.java
Outdated
Show resolved
Hide resolved
I don't spot anything that's blocking in my review, but will liket @stoletheminerals give a look and do sign off |
I am also planning to take a look tomorrow. |
The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "safebrowsing, safe browsing" and so security team members have been added as reviewers to take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
..._browsing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingUtils.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
...sing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingApiHandler.java
Show resolved
Hide resolved
// Delegate is used to turn off safe browsing option as every | ||
// request is | ||
// delayed when it's turned on and not working | ||
mBraveSafeBrowsingApiHandlerDelegate.turnSafeBrowsingOff(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this update the toggle in the UI settings to OFF? We need to make sure we don't claim that Safe Browsing is ON when we know it's not. This is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow-up, we should detect this case ahead of time and gray out the Safe Browsing setting entirely to make it clear that it cannot be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am re-checking this.
At current cr130 Nightly where SafeBrowsing doesn't work, the setting is not grayed and is toggled on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so the only thing we need to do is that if we detect that Safe Browsing is not working (e.g. it fails to initialize), we need to have the UI toggle OFF in order to reflect that Safe Browsing is not actually ON. Otherwise we'll be claiming that we protect users when we're not.
Graying out when it's not available can be left as a follow-up issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's create a follow up for that as it is how it used to be, plus majority of user base is using Google Play. We can handle it later as currently nightly is without protection at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the mentioned commit after discussion with @SergeyZhukovsky .
ChromiumPlayServicesAvailability.isGooglePlayServicesAvailable
is an expensive call, marked as If at all possible, do not use this
The chance of that user without Google Play Services API will open preference without prior opening of any web site is low.
Current implementation turns the Safe Browsing
into off after first navigation to any web site.
So I am going to merge is once CI will be green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up issue assigned to me:
..._browsing/android/java/src/org/chromium/components/safe_browsing/BraveSafeBrowsingUtils.java
Show resolved
Hide resolved
Fixes brave/brave-browser#41407 Related Chromium change https://source.chromium.org/chromium/chromium/src/+/e5700c49b75254cc1201a3bbea59b20b06328a27 Remove remaining functions in the interface. Internal reference was removed in https://crrev.com/i/7648757 OBSOLETE_HISTOGRAMS=No longer logged because URLs are checked through the new GMSCore Safe Browsing API. Bug: 40935425 Change-Id: I3ab1e5783395c63586bd4c5163541161027004bb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5837639
dd4c302
to
8563732
Compare
[puLL-Merge] - brave/brave-core@25842 DescriptionThis PR reintroduces Safe Browsing functionality for Android that was previously removed or commented out. It implements a Brave-specific version of Safe Browsing that utilizes Google's SafetyNet API while maintaining Brave's privacy-focused approach. ChangesChanges
Possible Issues
Security Hotspots
Overall, this PR appears to be a significant update to Brave's SafeBrowsing implementation on Android, reintroducing functionality while maintaining Brave's privacy-focused approach. Careful testing and review of the SafeBrowsing logic and its integration with the rest of the app will be crucial to ensure both security and performance are maintained. |
8563732
to
b827f72
Compare
Released in v1.73.12 |
Verification PASSED on
Using the STR/Cases outlined via #25842 (comment), ensured that the interstitial pages are being displayed as per the following:
|
Resolves brave/brave-browser#41407
This PR brings back Safe Browsing by
SafetyNetClient
API internally with supplying modified codes intoSafeBrowsingApiHandler
.Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Expected to see interstitial Safe Browsing page with a warnings, similar to the ones which displays current Stable
1.70.123 Chromium: 129.0.6668.89