Backup Archive Integrity Tampering
backup_archive_integrity_tampering HARD
| Category | Insecure Data Storage |
| OWASP Mobile (2024) | M9 |
| MASVS | MASVS-STORAGE-2MASVS-RESILIENCE-3 |
| MASWE | MASWE-0006 |
| MASTG (v2 tests) | iOSMASTG-TEST-0387AndroidMASTG-TEST-0338 |
| MASTG demos | iOSMASTG-DEMO-0150AndroidMASTG-DEMO-0101 |
| CWE | CWE-345CWE-565CWE-494 |
| Platform | AndroidiOS |
| Platform notes | Android Auto Backup / adb backup archives; iOS iTunes/Finder & iCloud backups. Restore path is the boundary. |
Description
The app does not verify the INTEGRITY of a backup archive before restoring it, so an attacker extracts a backup, edits persisted state (entitlements, balances, feature flags, an is_premium/is_admin bit), re-packs it, and restores - and the app trusts the attacker-controlled state. This is the integrity direction of backups (not the read/leak direction): the restore path is the boundary (unsigned-backup tampering CVE-2025-49199 class, OWASP MASTG-BEST-0065).
How it works
The app restores a backup archive of persisted state without verifying its integrity. An attacker extracts the backup, edits security-relevant state (flips is_premium false to true, sets is_admin, raises the account balance), re-packs it, and restores, and the restore path applies the attacker-controlled state verbatim. On device the archive is written to a real file in the app documents container (swept up by a full device backup, recoverable from the device via adb-pullable, or via backup/jailbreak on iOS, and editable), and the unverified restore reads it back from disk. The secure path recomputes a keyed MAC over the archive and refuses any archive whose tag does not verify, while still accepting the genuine backup.
How to exercise it. DVMA is the harness - open this module from the home index and tap the demo action. The screen ships the malicious input and simulates the attacker (e.g. the companion app, crafted intent, or scanned payload) in-process, and the evidence panel prints the proof. The Tools (optional) and Attack inputs below are only needed to reproduce the exploit end-to-end on a real device.
Exploit steps
- Set up. Build DVMA with a flavor that enables the Insecure Data Storage category (e.g.
--dart-define-from-file=config/flavors/dev.json) and run on an emulator/simulator you control. The demo needs no external tooling; for the optional on-device reproduction the relevant tools are:sqlite3,xxd· Android:adb backup,apktool· iOS:idevicebackup2,plutil. - Locate the target. From the home index, open Backup Archive Integrity Tampering (
backup_archive_integrity_tampering). The How it works section above describes this module’s specific weakness; the screen states the intended-secure behavior and exposes the vulnerable action. - Exploit. Exercise the flow that persists data, then inspect on-device storage (
adb shell run-as <pkg>/ pull the app sandbox, orobjection’sandroid keystore/ios nsuserdefaultshelpers) and confirm the sensitive value is present in cleartext or without hardware backing. - Observe the evidence. Trigger the vulnerable action and read the evidence panel - it prints the concrete proof (leaked value, accepted replay, executed payload, or unauthorized result).
- Contrast with the secure path. Run the module’s secure/hardened action (where provided) and confirm the same attack is rejected - this is what a correct implementation should do.
- Map it back. Cross-reference the MASTG v2 test(s) MASTG-TEST-0338, MASTG-TEST-0387 for the canonical procedure and remediation.
Tools (optional)
Android
iOS
Attack inputs
Payloads/artifacts you author for the on-device attack. The demo already ships and simulates these in-process (e.g. the malicious companion app / crafted intent is emulated inside the screen), so you only need to craft them to reproduce the exploit on a real device:
tampered backup archive
Real-world references
Concrete public disclosures that match this vulnerability class:
- CVE-2025-49199 (unsigned backup archive modified and re-uploaded)
- OWASP MASTG-BEST-0065: implementing storage integrity checks