Repository navigation
feat(security): add tamper and jailbreak detection with graceful degradation (#1772) - #1822
Merged
github-actions[bot] merged 1 commit intoOct 17, 2026
Conversation
|
@amankoli09 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #1772 by implementing comprehensive tamper, root, and jailbreak detection for mobile clients (Android & iOS) with an accessible graceful degradation model and formal security policy documentation.
1. Detection Engine (
src/services/auth/deviceAttestationService.ts)subinaries and root paths (/system/xbin/su,/sbin/su,/data/local/xbin/su, etc.)./sbin/.magisk,/data/adb/magisk, etc.).com.topjohnwu.magisk,eu.chainfire.supersu, etc.).Build.TAGScontainingtest-keys.ro.debuggable=1,ro.secure=0)./Applications/Cydia.app,/Library/MobileSubstrate/MobileSubstrate.dylib,/bin/bash, etc.).cydia://,sileo://,zbra://, etc.)./private/).globalThis.frida,Process.arch,Module).XposedBridge).Function.prototype.toString).2. Graceful Degradation Model
Instead of hard crashing or locking users out of safe functionality:
VIEW_SUBSCRIPTIONS,VIEW_ANALYTICS,MANAGE_CATEGORIES,CHANGE_SETTINGS).EXECUTE_PAYMENT,SIGN_TRANSACTION,EXPORT_PRIVATE_KEYS,BIOMETRIC_AUTH,EXPORT_SENSITIVE_DATA).isOperationAllowed(op)and throwing assertionassertOperationAllowed(op).BiometricGateto bypass/restrict local biometrics safely when integrity is compromised.3. User Experience & Accessibility
DeviceIntegrityBanner(src/components/security/DeviceIntegrityBanner.tsx):accessibilityRole="alert", high-contrast WCAG 2.1 AA styling).HomeScreen.4. Policy Documentation
docs/DEVICE_INTEGRITY_POLICY.mdspecifying threat vectors, detection signals, risk classification matrix (Low, Medium, High, Critical), permitted vs restricted operations, and compliance references (OWASP MASVS, PCI DSS 6.5).docs/security.md.Verification & Tests
src/services/auth/__tests__/deviceAttestationService.test.ts(covers clean devices, Android root, iOS jailbreak, Frida tampering, emulator detection, graceful degradation matrix, cache lifecycle).src/hooks/__tests__/useDeviceIntegrity.test.ts(covers cache initialization, fresh probes, banner dismissal, and force recheck).src/components/security/__tests__/DeviceIntegrityBanner.test.tsx(covers rendering conditions, accessibility attributes, details expand/collapse, dismiss actions).node --experimental-strip-types --check.scripts/validate-autoscaling.js,scripts/anonymize-test-data.js).Closes #1772