You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
Hi, first of all kudos for the great work.
I'd like to discuss about an issue I'm having with this package.
In order to make it work with proguard I had to exclude the package from obfuscation with:
-keep class com.criticalblue.reactnative.** {
*;
}
Since the package is using reflection to access the certPinner:
try {
Classnoparams[] = {};
Classclazz = Class.forName("com.criticalblue.reactnative.GeneratedCertificatePinner");
Methodmethod = clazz.getDeclaredMethod("instance", noparams);
certificatePinner = (CertificatePinner) method.invoke(null);
Log.i(TAG, "Generated Certficate Pinner in use");
} catch(Exceptione){
Log.e(TAG, "No Generated Certficate Pinner found - likely a pinset configuration error");
Log.w(TAG, "CERTIFICATE PINNING NOT BEING USED");
}
But excluding this package from obfuscation makes it extremely trivial for an attacker to decompile and bypass the pinning feature.
Wouldn't it be better to manually import the com.criticalblue.reactnative.GeneratedCertificatePinner package inside of CertPinnerPackage.java and invoke the static instance method instead of relying on reflection?
This would improve Proguard obfuscation without breaking the functionality.
Thank you,
Francesco
The text was updated successfully, but these errors were encountered:
@kde3kko you have raised a good point. But if you go through the code at CertPinnerPackage.java line no 24 developer already commented: "create custom certificate pinner.needs to use reflection so that class can be generated outside the package library". This means the developer is already aware of the reflection at this point.
So @kde3kko, if we implement your suggested solution so it can impact the functionality.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, first of all kudos for the great work.
I'd like to discuss about an issue I'm having with this package.
In order to make it work with proguard I had to exclude the package from obfuscation with:
Since the package is using reflection to access the certPinner:
But excluding this package from obfuscation makes it extremely trivial for an attacker to decompile and bypass the pinning feature.
Wouldn't it be better to manually import the
com.criticalblue.reactnative.GeneratedCertificatePinner
package inside ofCertPinnerPackage.java
and invoke the staticinstance
method instead of relying on reflection?This would improve Proguard obfuscation without breaking the functionality.
Thank you,
Francesco
The text was updated successfully, but these errors were encountered: