Skip to content

Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios)#3793

Open
Copilot wants to merge 30 commits into
masterfrom
copilot/ma-0056-determining-sensitive-data-ipc
Open

Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios)#3793
Copilot wants to merge 30 commits into
masterfrom
copilot/ma-0056-determining-sensitive-data-ipc

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

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

    • The previously drafted tests-beta/ios/MASVS-PLATFORM/MASTG-TEST-0x56.md was removed.
  • No new demo added

    • The previously drafted demos/ios/MASVS-PLATFORM/MASTG-DEMO-0x56/ content was removed.
  • Theory and guidance coverage retained/expanded

    • IPC background is covered through the iOS IPC knowledge pages (including existing and newly added IPC-focused knowledge content in this branch).
    • Best-practice guidance is provided in 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)

    • Keeps the test deprecated and updates deprecation metadata to reflect the current status:
      • status: deprecated
      • covered_by: []
      • deprecation_note explains that existing content was insufficient for direct porting and that new focused MASTG v2 tests will be created later for relevant IPC parts.

Copilot AI and others added 10 commits May 9, 2026 19:16
Copilot AI changed the title [WIP] Create MASTG v2 test for sensitive data exposure via IPC mechanisms Port MASTG-TEST-0056 to v2 for iOS IPC sensitive-data exposure, with linked demo/knowledge/best-practice content May 9, 2026
Copilot AI requested a review from cpholguera May 9, 2026 19:23
@cpholguera
Copy link
Copy Markdown
Collaborator

@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)

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@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)

Addressed in commit 6f54d9c.

I switched all newly added porting artifacts to fake IDs (MASTG-TEST-0x56, MASTG-DEMO-0x56, MASTG-KNOW-0x56, MASTG-BEST-0x56) and updated cross-references accordingly. I also deprecated the v1 test at tests/ios/MASVS-PLATFORM/MASTG-TEST-0056.md with status: deprecated, covered_by: [MASTG-TEST-0x56], and deprecation_note.

No UI changes were made in this PR, so no screenshot applies.

@cpholguera cpholguera changed the title Port MASTG-TEST-0056 to v2 for iOS IPC sensitive-data exposure, with linked demo/knowledge/best-practice content Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios) May 10, 2026
@cpholguera
Copy link
Copy Markdown
Collaborator

@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.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 10, 2026

@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...

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 best-practices/MASTG-BEST-0x56.md to remove links to removed draft IDs in commit 0ae961b.

No UI changes were made, so no screenshot applies.

Copilot AI changed the title Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios) iOS IPC: focus on theory and best practices, deprecate MASTG-TEST-0056 pending new v2 tests May 10, 2026
@cpholguera cpholguera requested review from ab-rizk and removed request for cpholguera May 10, 2026 12:22
@cpholguera cpholguera changed the title iOS IPC: focus on theory and best practices, deprecate MASTG-TEST-0056 pending new v2 tests Port MASTG-TEST-0056 to v2: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios) May 10, 2026
@cpholguera cpholguera marked this pull request as ready for review May 10, 2026 16:22
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you wanna mention BLE and NFC here? Since they're also network-based

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MASTG v1->v2 MASTG-TEST-0056: Determining Whether Sensitive Data Is Exposed via IPC Mechanisms (ios)

3 participants