AdguardTeam / CoreLibs

Core Adguard libraries
https://adguard.com/
Apache License 2.0
40 stars 7 forks source link

Consider enabling OCSP check on Android #1498

Open unclebearbot opened 3 years ago

unclebearbot commented 3 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Issue Details

Expected Behavior

  1. Turn on HTTPS filtering and install the certificate provided by AdGuard.
  2. Open https://revoked.badssl.com which is signed by a revoked certificate.
  3. The page is supposed to be blocked as shown in below screenshot 1.

Actual Behavior

The page was not blocked but shown as trusted by AdGuard instead. Because AdGuard re-signed it with a valid certificate as below screenshot 2.

Screenshots

Screenshot: blocked by Firefox ![Screenshot_20210811-211826](https://user-images.githubusercontent.com/16894061/129136411-da5d5129-5109-4a09-8f32-193176cae89e.png)
Screenshot: re-signed by AdGuard ![Screenshot_20210811-211747](https://user-images.githubusercontent.com/16894061/129136468-e30ec378-c41a-4285-a634-fd724cc526f9.png)

Additional Information

Birbber commented 3 years ago

@nvxarm It's an expected behavior. In terms of checking certificates we copy the behavior of most browsers, but they don't use OCSP on android (apparently to save traffic and reduce the already large network delays), so it isn't considered as a bug.

unclebearbot commented 3 years ago

Thanks for the detailed explanation.

Is there any plan to implement such function? As Firefox can recognize and block it, without adding any observable overhead.

It would be important when encountering public security incidents such as the disclosure of private keys.

Birbber commented 3 years ago

@nvxarm We didn't plan to implement such feature, but will think about it later on. It will depend on the amount of users that might need it.

sfionov commented 3 years ago

Just to clarify: revocation checks are performed on Mac and Windows, and not performed on Android.

It is more than one solution for this task - detecting revocation-check-enabled browsers or providing an option to force it.

So, may be in future :)

unclebearbot commented 3 years ago

Thank you for your patience and glad to hear the confirmation.

BTW, Firefox seems to place OneCRL (and/or upcoming CRLite) in front of OCSP. Although it can’t cover all situations as it may still have to fallback to OCSP in theory, it just works well in practice. Furthermore, validations on short-lived signatures are skipped.

Maybe we can learn from its mechanism.