react-native-device-defense 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -242,33 +242,6 @@ static bool checkFridaInMaps() {
|
|
|
242
242
|
* Check for SSL validation bypass in system properties
|
|
243
243
|
*/
|
|
244
244
|
static bool checkSSLValidationBypass() {
|
|
245
|
-
const std::vector<std::string> propFiles = {
|
|
246
|
-
"/system/build.prop",
|
|
247
|
-
"/vendor/build.prop",
|
|
248
|
-
"/default.prop"
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
for (const auto& propFile : propFiles) {
|
|
252
|
-
if (!fileExists(propFile)) continue;
|
|
253
|
-
|
|
254
|
-
std::ifstream file(propFile);
|
|
255
|
-
std::string line;
|
|
256
|
-
|
|
257
|
-
while (std::getline(file, line)) {
|
|
258
|
-
// Check for SSL validation bypass indicators
|
|
259
|
-
if (line.find("ssl.untrusted=0") != std::string::npos) {
|
|
260
|
-
LOGD("Found SSL validation bypass in %s", propFile.c_str());
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
if (line.find("ro.debuggable") != std::string::npos &&
|
|
264
|
-
line.find("1") != std::string::npos) {
|
|
265
|
-
// Debuggable builds may have SSL validation bypassed
|
|
266
|
-
LOGD("Device is debuggable, SSL may be bypassed");
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
245
|
return false;
|
|
273
246
|
}
|
|
274
247
|
|
|
@@ -325,27 +298,6 @@ static bool checkSSLPinningBypass() {
|
|
|
325
298
|
* Check for proxy configuration that could intercept SSL traffic
|
|
326
299
|
*/
|
|
327
300
|
static bool checkProxyConfiguration() {
|
|
328
|
-
// Check for HTTP proxy in system properties
|
|
329
|
-
const std::vector<std::string> propFiles = {
|
|
330
|
-
"/system/build.prop",
|
|
331
|
-
"/vendor/build.prop"
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
for (const auto& propFile : propFiles) {
|
|
335
|
-
if (!fileExists(propFile)) continue;
|
|
336
|
-
|
|
337
|
-
std::ifstream file(propFile);
|
|
338
|
-
std::string line;
|
|
339
|
-
|
|
340
|
-
while (std::getline(file, line)) {
|
|
341
|
-
if (line.find("http.proxy") != std::string::npos ||
|
|
342
|
-
line.find("https.proxy") != std::string::npos) {
|
|
343
|
-
LOGD("Found proxy configuration in %s", propFile.c_str());
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
301
|
// Check for proxy environment variables
|
|
350
302
|
if (getenv("http_proxy") != nullptr || getenv("https_proxy") != nullptr) {
|
|
351
303
|
LOGD("Found proxy environment variables");
|
|
@@ -401,8 +353,7 @@ static bool checkModifiedSSLLibraries() {
|
|
|
401
353
|
static bool checkCertificateTampering() {
|
|
402
354
|
// Check for user-installed CA certificates
|
|
403
355
|
const std::vector<std::string> certPaths = {
|
|
404
|
-
"/data/misc/keychain/cacerts-added"
|
|
405
|
-
"/system/etc/security/cacerts"
|
|
356
|
+
"/data/misc/keychain/cacerts-added"
|
|
406
357
|
};
|
|
407
358
|
|
|
408
359
|
for (const auto& certPath : certPaths) {
|
|
@@ -421,8 +372,8 @@ static bool checkCertificateTampering() {
|
|
|
421
372
|
closedir(dir);
|
|
422
373
|
|
|
423
374
|
// Too many user certificates might indicate tampering
|
|
424
|
-
if (certCount >
|
|
425
|
-
LOGD("Suspicious number of certificates: %d", certCount);
|
|
375
|
+
if (certCount > 10) {
|
|
376
|
+
LOGD("Suspicious number of user certificates: %d", certCount);
|
|
426
377
|
return true;
|
|
427
378
|
}
|
|
428
379
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-device-defense",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Multi-layer device security detection for React Native (root, hook, debugger, emulator detection)",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|