react-native-device-defense 1.1.0 → 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,28 +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
|
-
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
245
|
return false;
|
|
268
246
|
}
|
|
269
247
|
|
|
@@ -320,27 +298,6 @@ static bool checkSSLPinningBypass() {
|
|
|
320
298
|
* Check for proxy configuration that could intercept SSL traffic
|
|
321
299
|
*/
|
|
322
300
|
static bool checkProxyConfiguration() {
|
|
323
|
-
// Check for HTTP proxy in system properties
|
|
324
|
-
const std::vector<std::string> propFiles = {
|
|
325
|
-
"/system/build.prop",
|
|
326
|
-
"/vendor/build.prop"
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
for (const auto& propFile : propFiles) {
|
|
330
|
-
if (!fileExists(propFile)) continue;
|
|
331
|
-
|
|
332
|
-
std::ifstream file(propFile);
|
|
333
|
-
std::string line;
|
|
334
|
-
|
|
335
|
-
while (std::getline(file, line)) {
|
|
336
|
-
if (line.find("http.proxy") != std::string::npos ||
|
|
337
|
-
line.find("https.proxy") != std::string::npos) {
|
|
338
|
-
LOGD("Found proxy configuration in %s", propFile.c_str());
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
301
|
// Check for proxy environment variables
|
|
345
302
|
if (getenv("http_proxy") != nullptr || getenv("https_proxy") != nullptr) {
|
|
346
303
|
LOGD("Found proxy environment variables");
|
|
@@ -396,8 +353,7 @@ static bool checkModifiedSSLLibraries() {
|
|
|
396
353
|
static bool checkCertificateTampering() {
|
|
397
354
|
// Check for user-installed CA certificates
|
|
398
355
|
const std::vector<std::string> certPaths = {
|
|
399
|
-
"/data/misc/keychain/cacerts-added"
|
|
400
|
-
"/system/etc/security/cacerts"
|
|
356
|
+
"/data/misc/keychain/cacerts-added"
|
|
401
357
|
};
|
|
402
358
|
|
|
403
359
|
for (const auto& certPath : certPaths) {
|
|
@@ -416,8 +372,8 @@ static bool checkCertificateTampering() {
|
|
|
416
372
|
closedir(dir);
|
|
417
373
|
|
|
418
374
|
// Too many user certificates might indicate tampering
|
|
419
|
-
if (certCount >
|
|
420
|
-
LOGD("Suspicious number of certificates: %d", certCount);
|
|
375
|
+
if (certCount > 10) {
|
|
376
|
+
LOGD("Suspicious number of user certificates: %d", certCount);
|
|
421
377
|
return true;
|
|
422
378
|
}
|
|
423
379
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-device-defense",
|
|
3
|
-
"version": "1.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",
|