Keychain Access-Group Authorization Confusion

← Insecure Data Storage

keychain_access_group_authorization_confusion   HARD

CategoryInsecure Data Storage
OWASP Mobile (2024)M9
MASVSMASVS-STORAGE-1MASVS-AUTH-1
MASWEMASWE-0001
MASTG (v2 tests)iOSMASTG-TEST-0388AndroidNone
CWECWE-522CWE-284CWE-668
PlatformiOS

Description

Over-broad kSecAttrAccessGroup / a shared access group / synchronizable or wrongly-scoped accessibility flags let another app, extension, or user read Keychain items that should be isolated to this app, so items leak across the intended authorization boundary (iOS Keychain access-authorization CVE-2026-28864 class).

How it works

A sensitive keychain item is scoped to an access group that is too broad to isolate it, and marked synchronizable, so a different app or extension can still read an item that should be private to the owning app. This is an authorization confusion at the access-group boundary, distinct from weak item-accessibility misuse. The in-app model shows the extreme case (a shared/wildcard group served to any caller); on a real iOS device the same confusion is reproduced with Security.framework by storing the secret synchronizable and NOT scoped to an app-private access group (so it lands in the default app+extensions group), then reading it back across the boundary via SecItemAdd / SecItemCopyMatching. On device the secret is also persisted to a Keychain/UserDefaults item, recoverable in cleartext from an unencrypted device backup or a jailbroken device (SSH/SCP or Filza; keychain-dumper). The secure path rejects the over-broad stored group and requires an exact app-private access-group match, refusing cross-group reads.

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

  1. 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 iOS simulator / a device you control. The demo needs no external tooling; for the optional on-device reproduction the relevant tools are: objection, frida, r2frida, keychain-dumper, codesign.
  2. Locate the target. From the home index, open Keychain Access-Group Authorization Confusion (keychain_access_group_authorization_confusion). The How it works section above describes this module’s specific weakness; the screen states the intended-secure behavior and exposes the vulnerable action.
  3. Exploit. Exercise the flow that persists data, then inspect the app sandbox (objection’s ios nsuserdefaults/ios plist cat/ios keychain dump helpers, or pull the container over ifuse) and confirm the sensitive value is present in cleartext or without hardware backing.
  4. 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).
  5. 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.
  6. Map it back. Cross-reference the MASTG v2 test(s) MASTG-TEST-0388 for the canonical procedure and remediation.

Tools (optional)

Real-world references

Concrete public disclosures that match this vulnerability class: