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

Ability for integrators to disable SafetyNet checks #1971

Closed
SkewedZeppelin opened this issue Jul 4, 2023 · 6 comments
Closed

Ability for integrators to disable SafetyNet checks #1971

SkewedZeppelin opened this issue Jul 4, 2023 · 6 comments
Labels
enhancement 🔒 Integrity Play Integrity, SafetyNet, DroidGuard and ReCAPTCHA
Milestone

Comments

@SkewedZeppelin
Copy link

Is your feature request related to a problem? Please describe.
I'd like to add optional opt-in unprivileged microG support to DivestOS, however SafetyNet both won't ever succeed on it nor do I want my users needlessly running the proprietary DroidGuard executables.

Describe the solution you'd like
An option in the microg.xml settings override to force disable and hide any function that directly downloads/executes more proprietary code.

@mar-v-in mar-v-in added 🔒 Integrity Play Integrity, SafetyNet, DroidGuard and ReCAPTCHA good first issue labels Jul 4, 2023
@mar-v-in mar-v-in added this to the 0.2.29 milestone Jul 4, 2023
SkewedZeppelin added a commit to Divested-Mobile/DivestOS-Build that referenced this issue Jul 4, 2023
TODO after fixed:
SafetyNet: microg/GmsCore#1971
Geocoder: microg/GmsCore#1972

Signed-off-by: Tad <tad@spotco.us>
@mar-v-in
Copy link
Member

mar-v-in commented Jul 6, 2023

After further investigation, I figured:

  • Even without running DroidGuard, we can support SafetyNet for ReCAPTCHA (probably asking the users every time to fill in captchas) and ReCAPTCHA Enterprise (users may receive a lower score and thus may not be able to use some apps)
  • We also support using a remote DroidGuard service, this works even on devices and systems where it wouldn't work otherwise.

So instead of disabling all UI for SafetyNet via microg.xml, I think it makes more sense to just disable local DroidGuard execution.

That said, given the large amount of devices supported by DivestOS, how do you know that SafeyNet/DroidGuard won't pass on any of them? Privileged access is not strictly required (at least not on all devices) to pass SafetyNet.

@SkewedZeppelin
Copy link
Author

SkewedZeppelin commented Jul 6, 2023

I think it makes more sense to just disable local DroidGuard execution.

That is a good approach.

how do you know that SafeyNet/DroidGuard won't pass on any of them

I completely remove the default/stock OS fingerprints that LineageOS uses, it was a prereq for actually supporting delta/incremental OTA updates.
And I'm not going to ship ih8sn or the snet downgrade patchsets like other systems.

@mar-v-in
Copy link
Member

mar-v-in commented Jul 6, 2023

I completely remove the default/stock OS fingerprints that LineageOS uses, it was a prereq for actually supporting delta/incremental OTA updates.

The device profile feature in microG can be used to spoof fingerprints to DroidGuard to pass SafetyNet when needed.

@SkewedZeppelin
Copy link
Author

I did actually try the self test on both clark/17.1 (can't be relocked) and taimen/20.0 (relocked bootloader and verified boot enforcing) and both said "CTS profile match failed" iirc.

@mar-v-in
Copy link
Member

mar-v-in commented Jul 6, 2023

I don't say it's going to work for all devices easily. Pixel devices are harder and unlocked bootloader generally doesn't work without kernel patch that hides the bootloader state (which is trivial though).

Anyway. With 4772008 there is now an boolean option in microg.xml called droidguard_force_local_disabled which you can set to true.

@SkewedZeppelin
Copy link
Author

Thank you for these additions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🔒 Integrity Play Integrity, SafetyNet, DroidGuard and ReCAPTCHA
Projects
None yet
Development

No branches or pull requests

2 participants