Skip to content
Last updated: June 20, 2025

MASTG-TEST-0278: Pasteboard Contents Not Cleared After Use

Overview

This test checks if the app clears the contents of the general pasteboard when it moves to the background or terminates. If sensitive data is left in the pasteboard, it can be accessed by other apps, leading to potential data leaks.

Apps can clear the contents of the general pasteboard by setting UIPasteboard.general.items = [] in the appropriate lifecycle methods, such as applicationDidEnterBackground: or applicationWillTerminate:.

Steps

  1. Run a static analysis scan using radare2 for iOS to detect usage of the UIPasteboard.general property.
  2. Run a static analysis scan using radare2 for iOS to detect usage of the UIPasteboard.setItems method.

Observation

The output should contain a list of locations where relevant APIs are used.

Evaluation

The test fails if the app uses the general pasteboard and does not clear its contents when moving to the background or terminating. Specifically, it should be verified that there are calls to UIPasteboard.setItems with an empty array ([]) in the appropriate lifecycle methods.

OSZAR »