Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios)#3793
Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios)#3793Copilot wants to merge 30 commits into
Conversation
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/4365f6e1-bd68-452f-b7c3-696d243b8004 Co-authored-by: cpholguera <[email protected]>
|
@copilot Ensure you followed the relevant instructions in .gitHub/instructions for porting and creation (for example you didn't use fake IDs and you didn't deprecate the old test) |
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/7d67b6c0-ad75-4101-927a-a1b9cff4f144 Co-authored-by: cpholguera <[email protected]>
Addressed in commit I switched all newly added porting artifacts to fake IDs ( No UI changes were made in this PR, so no screenshot applies. |
…ences, clarifying data handling guidelines, and adding new sections on validating incoming IPC data and securing document exchange flows.
…entation and focus on updated best practices.
… status and future plans
|
@copilot Check the latest changes in their PR and update the description. For now, we're not going to create new tests since they were insufficient. Instead, we will cover the relevant theory and best practices, and create new tests for the relevant parts in MASTG v2. |
Agent-Logs-Url: https://github.com/OWASP/mastg/sessions/9622f0ad-fd6f-4a03-8586-38934b8aaef2 Co-authored-by: cpholguera <[email protected]>
Updated to match the latest PR scope. The branch now reflects documentation-first coverage (theory + best practices) and no new v2 test/demo for this item right now. I also aligned No UI changes were made, so no screenshot applies. |
| iOS does not provide a general-purpose mechanism for arbitrary third-party apps to communicate directly. Instead, apps exchange data through platform-mediated channels, user actions, shared entitlements, or network interfaces. | ||
|
|
||
| In contrast to Android's rich Inter-Process Communication (IPC) capability, iOS offers some rather limited options for communication between apps. In fact, there's no way for apps to communicate directly. In this section we will present the different types of indirect communication offered by iOS and how to test them. Here's an overview: | ||
| Each [IPC mechanism](https://developer.apple.com/forums/tags/inter-process-communication) can be characterized by who can send data, who can receive data, whether user interaction is required, how long the data remains available, and whether the channel is restricted by an entitlement or app group. |
There was a problem hiding this comment.
nit: You might wanna remove this link IMHO, it links to Apple's forums with the IPC tag which is not very active.
| --- | ||
|
|
||
| During implementation of a mobile application, developers may apply traditional techniques for IPC (such as using shared files or network sockets). The IPC system functionality offered by mobile application platforms should be used because it is much more mature than traditional techniques. Using IPC mechanisms with no security in mind may cause the application to leak or expose sensitive data. | ||
| iOS does not provide a general-purpose mechanism for arbitrary third-party apps to communicate directly. Instead, apps exchange data through platform-mediated channels, user actions, shared entitlements, or network interfaces. |
There was a problem hiding this comment.
| iOS does not provide a general-purpose mechanism for arbitrary third-party apps to communicate directly. Instead, apps exchange data through platform-mediated channels, user actions, shared entitlements, or network interfaces. | |
| iOS does not provide a general-purpose mechanism for third-party apps to communicate directly. Instead, apps exchange data through platform-mediated interfaces of varying levels of abstraction. |
| knowledge: [MASTG-KNOW-0083, MASTG-KNOW-0079, MASTG-KNOW-0080, MASTG-KNOW-0081, MASTG-KNOW-0082, MASTG-KNOW-0x01, MASTG-KNOW-0x02, MASTG-KNOW-0x03, MASTG-KNOW-0x04, MASTG-KNOW-0x05, MASTG-KNOW-0x06, MASTG-KNOW-0x07, MASTG-KNOW-0x08, MASTG-KNOW-0104] | ||
| --- | ||
|
|
||
| When your app exchanges data across iOS IPC channels, share the minimum amount of data for the shortest time possible. Design these flows so that intercepted, persisted, logged, indexed, donated, or forwarded payloads are low value and short lived. |
There was a problem hiding this comment.
nit: Maybe you wanna mention least privilege and input sanitization/validation here?
| knowledge: [MASTG-KNOW-0083, MASTG-KNOW-0079, MASTG-KNOW-0080, MASTG-KNOW-0081, MASTG-KNOW-0082, MASTG-KNOW-0x01, MASTG-KNOW-0x02, MASTG-KNOW-0x03, MASTG-KNOW-0x04, MASTG-KNOW-0x05, MASTG-KNOW-0x06, MASTG-KNOW-0x07, MASTG-KNOW-0x08, MASTG-KNOW-0104] | ||
| --- | ||
|
|
||
| When your app exchanges data across iOS IPC channels, share the minimum amount of data for the shortest time possible. Design these flows so that intercepted, persisted, logged, indexed, donated, or forwarded payloads are low value and short lived. |
There was a problem hiding this comment.
| When your app exchanges data across iOS IPC channels, share the minimum amount of data for the shortest time possible. Design these flows so that intercepted, persisted, logged, indexed, donated, or forwarded payloads are low value and short lived. | |
| When your app exchanges data across iOS IPC channels, share the minimum amount of data for the shortest time possible. Design these flows so that intercepted payloads are low value and short lived. |
|
|
||
| ## Avoid Unsupported Low-Level IPC | ||
|
|
||
| Do not use low-level mechanisms such as XPC, Mach ports, or CFMessagePort as general-purpose app-to-app IPC channels for unrelated third-party iOS apps. Prefer Apple-supported system-mediated APIs, App Groups, Keychain access groups, document exchange, App Intents, Siri Shortcuts, Handoff, or network protocols where appropriate. |
There was a problem hiding this comment.
As you mention below, XPC is not usable for app-to-app communication anyway but the opposite is implied in:
Do not use low-level mechanisms such as XPC, Mach ports, or CFMessagePort as general-purpose app-to-app IPC channels for unrelated third-party iOS apps.
|
|
||
| Any app or extension in the App Group can potentially read or modify shared data, so avoid storing secrets, session tokens, or high-value personal data unless strictly necessary. | ||
|
|
||
| ## Limit Shared Keychain Access |
There was a problem hiding this comment.
You might wanna mention not storing overly sensitive data like (hashed) passwords since jailbroken devices can read the keychain of any process.
|
|
||
| ## Prefer Short-Lived Exchange Data | ||
|
|
||
| For URL-based handoff, such as [custom URL schemes](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app) and [Universal Links](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app), avoid embedding long-lived secrets, tokens, credentials, or personal data in URLs. Use one-time or short-lived references and have the receiving side redeem them through an authenticated channel. |
There was a problem hiding this comment.
| For URL-based handoff, such as [custom URL schemes](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app) and [Universal Links](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app), avoid embedding long-lived secrets, tokens, credentials, or personal data in URLs. Use one-time or short-lived references and have the receiving side redeem them through an authenticated channel. | |
| For URL-based interfaces, such as [custom URL schemes](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app) and [Universal Links](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app), avoid embedding long-lived secrets, tokens, credentials, or personal data in URLs. Use one-time or short-lived references and have the receiving side redeem them through an authenticated channel. |
|
|
||
| Apply the same pattern to Handoff, Siri Shortcuts, App Intents, shared files, and document exchange flows. Pass references, identifiers, or scoped URLs instead of full sensitive payloads whenever possible. | ||
|
|
||
| ## Validate All Incoming IPC Data |
There was a problem hiding this comment.
| ## Validate All Incoming IPC Data | |
| ## Validate All IPC Input |
| - Peer-to-peer communication between iOS devices on the same local network. | ||
| - Integration with network-accessible devices, such as printers, media players, or IoT hardware. | ||
|
|
||
| ## APIs |
There was a problem hiding this comment.
Do you wanna mention BLE and NFC here? Since they're also network-based
This PR no longer introduces a new MASTG v2 test for iOS IPC. Based on review feedback, the previous draft test coverage was considered insufficient, so the scope was adjusted to focus on theory and best-practice guidance for iOS IPC, while deferring new v2 tests to follow-up work for specific IPC mechanisms.
No new v2 test added
tests-beta/ios/MASVS-PLATFORM/MASTG-TEST-0x56.mdwas removed.No new demo added
demos/ios/MASVS-PLATFORM/MASTG-DEMO-0x56/content was removed.Theory and guidance coverage retained/expanded
best-practices/MASTG-BEST-0x56.md, with cross-links aligned to current knowledge entries and without linking to removed draft test IDs.v1 deprecation update (
tests/ios/MASVS-PLATFORM/MASTG-TEST-0056.md)status: deprecatedcovered_by: []deprecation_noteexplains that existing content was insufficient for direct porting and that new focused MASTG v2 tests will be created later for relevant IPC parts.