Entitlement Keychain Access Groups Wildcard

ID

swift.entitlement_keychain_access_groups_wildcard

Severity

high

Remediation Complexity

trivial

Remediation Risk

medium

Remediation Effort

medium

Resource

Misconfiguration

Language

Swift

Tags

ASVS50:v13.2.4, CWE:732, MASVS:MSTG-STORAGE-1

Description

The keychain-access-groups entitlement declares the set of access groups the app may read from or write to in the iOS Keychain. Entries normally carry the form <TeamID>.<bundle> — a literal, team-scoped identifier. A wildcard entry ( or anything containing ) drops that scoping and lets the app share secrets with keychain trust groups whose contents the developer never explicitly opted into. An empty-string entry is symptomatic of a leftover template/placeholder that the build accepted silently and has the same broad effect at runtime.

<key>keychain-access-groups</key>
<array>
    <string>ABCD1234.com.example.app</string>
    <string>*</string>           <!-- FLAW -->
    <string></string>            <!-- FLAW -->
</array>

Rationale

Broad keychain access groups undermine the isolation Keychain Services otherwise provides. Other apps with overlapping wildcard groups can read every credential the offending app writes.

Remediation

List each group explicitly with its team prefix; remove placeholder and * entries.

References